Fossil SCM
Add the "chng=" query parameter to the "/timeline" page.
Commit
b2b62b8318700f9f1e3efc179d4e71bddaf62756
Parent
6bcfe1d22c13281…
1 file changed
+35
+35
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1183,10 +1183,36 @@ | ||
| 1183 | 1183 | } |
| 1184 | 1184 | if( i>2 ){ |
| 1185 | 1185 | style_submenu_multichoice("y", i/2, az, isDisabled); |
| 1186 | 1186 | } |
| 1187 | 1187 | } |
| 1188 | + | |
| 1189 | +/* | |
| 1190 | +** If the zChng string is not NULL, then it should be a comma-separated | |
| 1191 | +** list of glob patterns for filenames. Add an term to the WHERE clause | |
| 1192 | +** for the SQL statement under construction that excludes any check-in that | |
| 1193 | +** does not modify one or more files matching the globs. | |
| 1194 | +*/ | |
| 1195 | +static void addFileGlobExclusion( | |
| 1196 | + const char *zChng, /* The filename GLOB list */ | |
| 1197 | + Blob *pSql /* The SELECT statement under construction */ | |
| 1198 | +){ | |
| 1199 | + if( zChng==0 || zChng[0]==0 ) return; | |
| 1200 | + blob_append_sql(pSql," AND event.objid IN (" | |
| 1201 | + "SELECT mlink.mid FROM mlink, filename" | |
| 1202 | + " WHERE mlink.fnid=filename.fnid AND %s)", | |
| 1203 | + glob_expr("filename.name", zChng)); | |
| 1204 | +} | |
| 1205 | +static void addFileGlobDescription( | |
| 1206 | + const char *zChng, /* The filename GLOB list */ | |
| 1207 | + Blob *pDescription /* Result description */ | |
| 1208 | +){ | |
| 1209 | + if( zChng==0 || zChng[0]==0 ) return; | |
| 1210 | + blob_appendf(pDescription, " that include changes to files matching %Q", | |
| 1211 | + zChng); | |
| 1212 | +} | |
| 1213 | + | |
| 1188 | 1214 | |
| 1189 | 1215 | /* |
| 1190 | 1216 | ** WEBPAGE: timeline |
| 1191 | 1217 | ** |
| 1192 | 1218 | ** Query parameters: |
| @@ -1209,10 +1235,12 @@ | ||
| 1209 | 1235 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1210 | 1236 | ** from=CHECKIN Path from... |
| 1211 | 1237 | ** to=CHECKIN ... to this |
| 1212 | 1238 | ** shortest ... show only the shortest path |
| 1213 | 1239 | ** uf=FILE_SHA1 Show only check-ins that contain the given file version |
| 1240 | +** chng=GLOBLIST Show only check-ins that involve changes to a file whose | |
| 1241 | +** name matches one of the comma-separate GLOBLIST. | |
| 1214 | 1242 | ** brbg Background color from branch name |
| 1215 | 1243 | ** ubg Background color from user |
| 1216 | 1244 | ** namechng Show only check-ins that have filename changes |
| 1217 | 1245 | ** forks Show only forks and their children |
| 1218 | 1246 | ** ym=YYYY-MM Show only events for the given year/month. |
| @@ -1245,10 +1273,11 @@ | ||
| 1245 | 1273 | const char *zSearch = P("s"); /* Search string */ |
| 1246 | 1274 | const char *zUses = P("uf"); /* Only show check-ins hold this file */ |
| 1247 | 1275 | const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */ |
| 1248 | 1276 | const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */ |
| 1249 | 1277 | const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */ |
| 1278 | + const char *zChng = P("chng"); /* List of GLOBs for files that changed */ | |
| 1250 | 1279 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1251 | 1280 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1252 | 1281 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1253 | 1282 | int bisectOnly = PB("bisect"); /* Show the check-ins of the bisect */ |
| 1254 | 1283 | int tagid; /* Tag ID */ |
| @@ -1437,17 +1466,21 @@ | ||
| 1437 | 1466 | blob_append_sql(&sql, ",%d", p->rid); |
| 1438 | 1467 | p = p->u.pTo; |
| 1439 | 1468 | } |
| 1440 | 1469 | blob_append(&sql, ")", -1); |
| 1441 | 1470 | path_reset(); |
| 1471 | + addFileGlobExclusion(zChng, &sql); | |
| 1442 | 1472 | tmFlags |= TIMELINE_DISJOINT; |
| 1443 | 1473 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1474 | + style_submenu_binary("v","With Files","Without Files", | |
| 1475 | + zType[0]!='a' && zType[0]!='c'); | |
| 1444 | 1476 | blob_appendf(&desc, "%d check-ins going from ", |
| 1445 | 1477 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1446 | 1478 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1447 | 1479 | blob_append(&desc, " to ", -1); |
| 1448 | 1480 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| 1481 | + addFileGlobDescription(zChng, &desc); | |
| 1449 | 1482 | }else if( (p_rid || d_rid) && g.perm.Read ){ |
| 1450 | 1483 | /* If p= or d= is present, ignore all other parameters other than n= */ |
| 1451 | 1484 | char *zUuid; |
| 1452 | 1485 | int np, nd; |
| 1453 | 1486 | |
| @@ -1520,10 +1553,11 @@ | ||
| 1520 | 1553 | int n; |
| 1521 | 1554 | const char *zEType = "timeline item"; |
| 1522 | 1555 | char *zDate; |
| 1523 | 1556 | Blob cond; |
| 1524 | 1557 | blob_zero(&cond); |
| 1558 | + addFileGlobExclusion(zChng, &cond); | |
| 1525 | 1559 | if( zUses ){ |
| 1526 | 1560 | blob_append_sql(&cond, " AND event.objid IN usesfile "); |
| 1527 | 1561 | } |
| 1528 | 1562 | if( renameOnly ){ |
| 1529 | 1563 | blob_append_sql(&cond, " AND event.objid IN rnfile "); |
| @@ -1730,10 +1764,11 @@ | ||
| 1730 | 1764 | tmFlags |= TIMELINE_DISJOINT; |
| 1731 | 1765 | }else if( zBrName ){ |
| 1732 | 1766 | blob_appendf(&desc, " related to \"%h\"", zBrName); |
| 1733 | 1767 | tmFlags |= TIMELINE_DISJOINT; |
| 1734 | 1768 | } |
| 1769 | + addFileGlobDescription(zChng, &desc); | |
| 1735 | 1770 | if( rAfter>0.0 ){ |
| 1736 | 1771 | if( rBefore>0.0 ){ |
| 1737 | 1772 | blob_appendf(&desc, " occurring between %h and %h.<br />", |
| 1738 | 1773 | zAfter, zBefore); |
| 1739 | 1774 | }else{ |
| 1740 | 1775 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1183,10 +1183,36 @@ | |
| 1183 | } |
| 1184 | if( i>2 ){ |
| 1185 | style_submenu_multichoice("y", i/2, az, isDisabled); |
| 1186 | } |
| 1187 | } |
| 1188 | |
| 1189 | /* |
| 1190 | ** WEBPAGE: timeline |
| 1191 | ** |
| 1192 | ** Query parameters: |
| @@ -1209,10 +1235,12 @@ | |
| 1209 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1210 | ** from=CHECKIN Path from... |
| 1211 | ** to=CHECKIN ... to this |
| 1212 | ** shortest ... show only the shortest path |
| 1213 | ** uf=FILE_SHA1 Show only check-ins that contain the given file version |
| 1214 | ** brbg Background color from branch name |
| 1215 | ** ubg Background color from user |
| 1216 | ** namechng Show only check-ins that have filename changes |
| 1217 | ** forks Show only forks and their children |
| 1218 | ** ym=YYYY-MM Show only events for the given year/month. |
| @@ -1245,10 +1273,11 @@ | |
| 1245 | const char *zSearch = P("s"); /* Search string */ |
| 1246 | const char *zUses = P("uf"); /* Only show check-ins hold this file */ |
| 1247 | const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */ |
| 1248 | const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */ |
| 1249 | const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */ |
| 1250 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1251 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1252 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1253 | int bisectOnly = PB("bisect"); /* Show the check-ins of the bisect */ |
| 1254 | int tagid; /* Tag ID */ |
| @@ -1437,17 +1466,21 @@ | |
| 1437 | blob_append_sql(&sql, ",%d", p->rid); |
| 1438 | p = p->u.pTo; |
| 1439 | } |
| 1440 | blob_append(&sql, ")", -1); |
| 1441 | path_reset(); |
| 1442 | tmFlags |= TIMELINE_DISJOINT; |
| 1443 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1444 | blob_appendf(&desc, "%d check-ins going from ", |
| 1445 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1446 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1447 | blob_append(&desc, " to ", -1); |
| 1448 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| 1449 | }else if( (p_rid || d_rid) && g.perm.Read ){ |
| 1450 | /* If p= or d= is present, ignore all other parameters other than n= */ |
| 1451 | char *zUuid; |
| 1452 | int np, nd; |
| 1453 | |
| @@ -1520,10 +1553,11 @@ | |
| 1520 | int n; |
| 1521 | const char *zEType = "timeline item"; |
| 1522 | char *zDate; |
| 1523 | Blob cond; |
| 1524 | blob_zero(&cond); |
| 1525 | if( zUses ){ |
| 1526 | blob_append_sql(&cond, " AND event.objid IN usesfile "); |
| 1527 | } |
| 1528 | if( renameOnly ){ |
| 1529 | blob_append_sql(&cond, " AND event.objid IN rnfile "); |
| @@ -1730,10 +1764,11 @@ | |
| 1730 | tmFlags |= TIMELINE_DISJOINT; |
| 1731 | }else if( zBrName ){ |
| 1732 | blob_appendf(&desc, " related to \"%h\"", zBrName); |
| 1733 | tmFlags |= TIMELINE_DISJOINT; |
| 1734 | } |
| 1735 | if( rAfter>0.0 ){ |
| 1736 | if( rBefore>0.0 ){ |
| 1737 | blob_appendf(&desc, " occurring between %h and %h.<br />", |
| 1738 | zAfter, zBefore); |
| 1739 | }else{ |
| 1740 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1183,10 +1183,36 @@ | |
| 1183 | } |
| 1184 | if( i>2 ){ |
| 1185 | style_submenu_multichoice("y", i/2, az, isDisabled); |
| 1186 | } |
| 1187 | } |
| 1188 | |
| 1189 | /* |
| 1190 | ** If the zChng string is not NULL, then it should be a comma-separated |
| 1191 | ** list of glob patterns for filenames. Add an term to the WHERE clause |
| 1192 | ** for the SQL statement under construction that excludes any check-in that |
| 1193 | ** does not modify one or more files matching the globs. |
| 1194 | */ |
| 1195 | static void addFileGlobExclusion( |
| 1196 | const char *zChng, /* The filename GLOB list */ |
| 1197 | Blob *pSql /* The SELECT statement under construction */ |
| 1198 | ){ |
| 1199 | if( zChng==0 || zChng[0]==0 ) return; |
| 1200 | blob_append_sql(pSql," AND event.objid IN (" |
| 1201 | "SELECT mlink.mid FROM mlink, filename" |
| 1202 | " WHERE mlink.fnid=filename.fnid AND %s)", |
| 1203 | glob_expr("filename.name", zChng)); |
| 1204 | } |
| 1205 | static void addFileGlobDescription( |
| 1206 | const char *zChng, /* The filename GLOB list */ |
| 1207 | Blob *pDescription /* Result description */ |
| 1208 | ){ |
| 1209 | if( zChng==0 || zChng[0]==0 ) return; |
| 1210 | blob_appendf(pDescription, " that include changes to files matching %Q", |
| 1211 | zChng); |
| 1212 | } |
| 1213 | |
| 1214 | |
| 1215 | /* |
| 1216 | ** WEBPAGE: timeline |
| 1217 | ** |
| 1218 | ** Query parameters: |
| @@ -1209,10 +1235,12 @@ | |
| 1235 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1236 | ** from=CHECKIN Path from... |
| 1237 | ** to=CHECKIN ... to this |
| 1238 | ** shortest ... show only the shortest path |
| 1239 | ** uf=FILE_SHA1 Show only check-ins that contain the given file version |
| 1240 | ** chng=GLOBLIST Show only check-ins that involve changes to a file whose |
| 1241 | ** name matches one of the comma-separate GLOBLIST. |
| 1242 | ** brbg Background color from branch name |
| 1243 | ** ubg Background color from user |
| 1244 | ** namechng Show only check-ins that have filename changes |
| 1245 | ** forks Show only forks and their children |
| 1246 | ** ym=YYYY-MM Show only events for the given year/month. |
| @@ -1245,10 +1273,11 @@ | |
| 1273 | const char *zSearch = P("s"); /* Search string */ |
| 1274 | const char *zUses = P("uf"); /* Only show check-ins hold this file */ |
| 1275 | const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */ |
| 1276 | const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */ |
| 1277 | const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */ |
| 1278 | const char *zChng = P("chng"); /* List of GLOBs for files that changed */ |
| 1279 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1280 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1281 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1282 | int bisectOnly = PB("bisect"); /* Show the check-ins of the bisect */ |
| 1283 | int tagid; /* Tag ID */ |
| @@ -1437,17 +1466,21 @@ | |
| 1466 | blob_append_sql(&sql, ",%d", p->rid); |
| 1467 | p = p->u.pTo; |
| 1468 | } |
| 1469 | blob_append(&sql, ")", -1); |
| 1470 | path_reset(); |
| 1471 | addFileGlobExclusion(zChng, &sql); |
| 1472 | tmFlags |= TIMELINE_DISJOINT; |
| 1473 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1474 | style_submenu_binary("v","With Files","Without Files", |
| 1475 | zType[0]!='a' && zType[0]!='c'); |
| 1476 | blob_appendf(&desc, "%d check-ins going from ", |
| 1477 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1478 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1479 | blob_append(&desc, " to ", -1); |
| 1480 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| 1481 | addFileGlobDescription(zChng, &desc); |
| 1482 | }else if( (p_rid || d_rid) && g.perm.Read ){ |
| 1483 | /* If p= or d= is present, ignore all other parameters other than n= */ |
| 1484 | char *zUuid; |
| 1485 | int np, nd; |
| 1486 | |
| @@ -1520,10 +1553,11 @@ | |
| 1553 | int n; |
| 1554 | const char *zEType = "timeline item"; |
| 1555 | char *zDate; |
| 1556 | Blob cond; |
| 1557 | blob_zero(&cond); |
| 1558 | addFileGlobExclusion(zChng, &cond); |
| 1559 | if( zUses ){ |
| 1560 | blob_append_sql(&cond, " AND event.objid IN usesfile "); |
| 1561 | } |
| 1562 | if( renameOnly ){ |
| 1563 | blob_append_sql(&cond, " AND event.objid IN rnfile "); |
| @@ -1730,10 +1764,11 @@ | |
| 1764 | tmFlags |= TIMELINE_DISJOINT; |
| 1765 | }else if( zBrName ){ |
| 1766 | blob_appendf(&desc, " related to \"%h\"", zBrName); |
| 1767 | tmFlags |= TIMELINE_DISJOINT; |
| 1768 | } |
| 1769 | addFileGlobDescription(zChng, &desc); |
| 1770 | if( rAfter>0.0 ){ |
| 1771 | if( rBefore>0.0 ){ |
| 1772 | blob_appendf(&desc, " occurring between %h and %h.<br />", |
| 1773 | zAfter, zBefore); |
| 1774 | }else{ |
| 1775 |