Fossil SCM
Add the "forks" query parameter to the /timeline webpage, causing the timeline to show only check-ins associated with a fork.
Commit
ba2ec88b749a7655f02e40a05fa11675b5f02a4a
Parent
d3f9e588f7320b4…
1 file changed
+30
-1
+30
-1
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -352,11 +352,11 @@ | ||
| 352 | 352 | }else if( rid==vid ){ |
| 353 | 353 | @ <tr class="timelineCurrent"> |
| 354 | 354 | }else { |
| 355 | 355 | @ <tr> |
| 356 | 356 | } |
| 357 | - zDateLink = href("%R/timeline?c=%!S", zUuid); | |
| 357 | + zDateLink = href("%R/timeline?c=%!S&unhide", zUuid); | |
| 358 | 358 | @ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td> |
| 359 | 359 | @ <td class="timelineGraph"> |
| 360 | 360 | if( tmFlags & TIMELINE_UCOLOR ) zBgClr = zUser ? hash_color(zUser) : 0; |
| 361 | 361 | if( zType[0]=='c' |
| 362 | 362 | && (pGraph || zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0) |
| @@ -1217,10 +1217,11 @@ | ||
| 1217 | 1217 | ** shortest ... show only the shortest path |
| 1218 | 1218 | ** uf=FUUID Show only check-ins that use given file version |
| 1219 | 1219 | ** brbg Background color from branch name |
| 1220 | 1220 | ** ubg Background color from user |
| 1221 | 1221 | ** namechng Show only check-ins that filename changes |
| 1222 | +** forks Show only forks and their children | |
| 1222 | 1223 | ** ym=YYYY-MM Shown only events for the given year/month. |
| 1223 | 1224 | ** datefmt=N Override the date format |
| 1224 | 1225 | ** |
| 1225 | 1226 | ** p= and d= can appear individually or together. If either p= or d= |
| 1226 | 1227 | ** appear, then u=, y=, a=, and b= are ignored. |
| @@ -1250,10 +1251,11 @@ | ||
| 1250 | 1251 | const char *zUses = P("uf"); /* Only show check-ins hold this file */ |
| 1251 | 1252 | const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */ |
| 1252 | 1253 | const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */ |
| 1253 | 1254 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1254 | 1255 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1256 | + int forkOnly = PB("forks"); /* Show only forks and their children */ | |
| 1255 | 1257 | int tagid; /* Tag ID */ |
| 1256 | 1258 | int tmFlags = 0; /* Timeline flags */ |
| 1257 | 1259 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| 1258 | 1260 | const char *zThisUser = 0; /* Suppress links to this user */ |
| 1259 | 1261 | HQuery url; /* URL for various branch links */ |
| @@ -1356,10 +1358,30 @@ | ||
| 1356 | 1358 | "CREATE TEMP TABLE rnfile(rid INTEGER PRIMARY KEY);" |
| 1357 | 1359 | "INSERT OR IGNORE INTO rnfile" |
| 1358 | 1360 | " SELECT mid FROM mlink WHERE pfnid>0 AND pfnid!=fnid;" |
| 1359 | 1361 | ); |
| 1360 | 1362 | disableY = 1; |
| 1363 | + } | |
| 1364 | + if( forkOnly ){ | |
| 1365 | + db_multi_exec( | |
| 1366 | + "CREATE TEMP TABLE rnfork(rid INTEGER PRIMARY KEY);\n" | |
| 1367 | + "INSERT OR IGNORE INTO rnfork(rid)\n" | |
| 1368 | + " SELECT pid FROM plink\n" | |
| 1369 | + " WHERE (SELECT value FROM tagxref WHERE tagid=%d AND rid=cid)==" | |
| 1370 | + " (SELECT value FROM tagxref WHERE tagid=%d AND rid=pid)\n" | |
| 1371 | + " GROUP BY pid" | |
| 1372 | + " HAVING count(*)>1;\n" | |
| 1373 | + "INSERT OR IGNORE INTO rnfork(rid)" | |
| 1374 | + " SELECT cid FROM plink\n" | |
| 1375 | + " WHERE (SELECT value FROM tagxref WHERE tagid=%d AND rid=cid)==" | |
| 1376 | + " (SELECT value FROM tagxref WHERE tagid=%d AND rid=pid)\n" | |
| 1377 | + " AND pid IN rnfork;", | |
| 1378 | + TAG_BRANCH, TAG_BRANCH, TAG_BRANCH, TAG_BRANCH | |
| 1379 | + ); | |
| 1380 | + tmFlags |= TIMELINE_UNHIDE; | |
| 1381 | + zType = "ci"; | |
| 1382 | + disableY = 1; | |
| 1361 | 1383 | } |
| 1362 | 1384 | |
| 1363 | 1385 | style_header("Timeline"); |
| 1364 | 1386 | login_anonymous_available(); |
| 1365 | 1387 | timeline_temp_table(); |
| @@ -1486,10 +1508,13 @@ | ||
| 1486 | 1508 | blob_append_sql(&sql, " AND event.objid IN usesfile "); |
| 1487 | 1509 | } |
| 1488 | 1510 | if( renameOnly ){ |
| 1489 | 1511 | blob_append_sql(&sql, " AND event.objid IN rnfile "); |
| 1490 | 1512 | } |
| 1513 | + if( forkOnly ){ | |
| 1514 | + blob_append_sql(&sql, " AND event.objid IN rnfork "); | |
| 1515 | + } | |
| 1491 | 1516 | if( zYearMonth ){ |
| 1492 | 1517 | blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%m',event.mtime) ", |
| 1493 | 1518 | zYearMonth); |
| 1494 | 1519 | } |
| 1495 | 1520 | else if( zYearWeek ){ |
| @@ -1658,10 +1683,14 @@ | ||
| 1658 | 1683 | } |
| 1659 | 1684 | if( renameOnly ){ |
| 1660 | 1685 | blob_appendf(&desc, " that contain filename changes"); |
| 1661 | 1686 | tmFlags |= TIMELINE_DISJOINT|TIMELINE_FRENAMES; |
| 1662 | 1687 | } |
| 1688 | + if( forkOnly ){ | |
| 1689 | + blob_appendf(&desc, " associated with forks"); | |
| 1690 | + tmFlags |= TIMELINE_DISJOINT; | |
| 1691 | + } | |
| 1663 | 1692 | if( zUser ){ |
| 1664 | 1693 | blob_appendf(&desc, " by user %h", zUser); |
| 1665 | 1694 | tmFlags |= TIMELINE_DISJOINT; |
| 1666 | 1695 | } |
| 1667 | 1696 | if( zTagName ){ |
| 1668 | 1697 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -352,11 +352,11 @@ | |
| 352 | }else if( rid==vid ){ |
| 353 | @ <tr class="timelineCurrent"> |
| 354 | }else { |
| 355 | @ <tr> |
| 356 | } |
| 357 | zDateLink = href("%R/timeline?c=%!S", zUuid); |
| 358 | @ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td> |
| 359 | @ <td class="timelineGraph"> |
| 360 | if( tmFlags & TIMELINE_UCOLOR ) zBgClr = zUser ? hash_color(zUser) : 0; |
| 361 | if( zType[0]=='c' |
| 362 | && (pGraph || zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0) |
| @@ -1217,10 +1217,11 @@ | |
| 1217 | ** shortest ... show only the shortest path |
| 1218 | ** uf=FUUID Show only check-ins that use given file version |
| 1219 | ** brbg Background color from branch name |
| 1220 | ** ubg Background color from user |
| 1221 | ** namechng Show only check-ins that filename changes |
| 1222 | ** ym=YYYY-MM Shown only events for the given year/month. |
| 1223 | ** datefmt=N Override the date format |
| 1224 | ** |
| 1225 | ** p= and d= can appear individually or together. If either p= or d= |
| 1226 | ** appear, then u=, y=, a=, and b= are ignored. |
| @@ -1250,10 +1251,11 @@ | |
| 1250 | const char *zUses = P("uf"); /* Only show check-ins hold this file */ |
| 1251 | const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */ |
| 1252 | const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */ |
| 1253 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1254 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1255 | int tagid; /* Tag ID */ |
| 1256 | int tmFlags = 0; /* Timeline flags */ |
| 1257 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| 1258 | const char *zThisUser = 0; /* Suppress links to this user */ |
| 1259 | HQuery url; /* URL for various branch links */ |
| @@ -1356,10 +1358,30 @@ | |
| 1356 | "CREATE TEMP TABLE rnfile(rid INTEGER PRIMARY KEY);" |
| 1357 | "INSERT OR IGNORE INTO rnfile" |
| 1358 | " SELECT mid FROM mlink WHERE pfnid>0 AND pfnid!=fnid;" |
| 1359 | ); |
| 1360 | disableY = 1; |
| 1361 | } |
| 1362 | |
| 1363 | style_header("Timeline"); |
| 1364 | login_anonymous_available(); |
| 1365 | timeline_temp_table(); |
| @@ -1486,10 +1508,13 @@ | |
| 1486 | blob_append_sql(&sql, " AND event.objid IN usesfile "); |
| 1487 | } |
| 1488 | if( renameOnly ){ |
| 1489 | blob_append_sql(&sql, " AND event.objid IN rnfile "); |
| 1490 | } |
| 1491 | if( zYearMonth ){ |
| 1492 | blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%m',event.mtime) ", |
| 1493 | zYearMonth); |
| 1494 | } |
| 1495 | else if( zYearWeek ){ |
| @@ -1658,10 +1683,14 @@ | |
| 1658 | } |
| 1659 | if( renameOnly ){ |
| 1660 | blob_appendf(&desc, " that contain filename changes"); |
| 1661 | tmFlags |= TIMELINE_DISJOINT|TIMELINE_FRENAMES; |
| 1662 | } |
| 1663 | if( zUser ){ |
| 1664 | blob_appendf(&desc, " by user %h", zUser); |
| 1665 | tmFlags |= TIMELINE_DISJOINT; |
| 1666 | } |
| 1667 | if( zTagName ){ |
| 1668 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -352,11 +352,11 @@ | |
| 352 | }else if( rid==vid ){ |
| 353 | @ <tr class="timelineCurrent"> |
| 354 | }else { |
| 355 | @ <tr> |
| 356 | } |
| 357 | zDateLink = href("%R/timeline?c=%!S&unhide", zUuid); |
| 358 | @ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td> |
| 359 | @ <td class="timelineGraph"> |
| 360 | if( tmFlags & TIMELINE_UCOLOR ) zBgClr = zUser ? hash_color(zUser) : 0; |
| 361 | if( zType[0]=='c' |
| 362 | && (pGraph || zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0) |
| @@ -1217,10 +1217,11 @@ | |
| 1217 | ** shortest ... show only the shortest path |
| 1218 | ** uf=FUUID Show only check-ins that use given file version |
| 1219 | ** brbg Background color from branch name |
| 1220 | ** ubg Background color from user |
| 1221 | ** namechng Show only check-ins that filename changes |
| 1222 | ** forks Show only forks and their children |
| 1223 | ** ym=YYYY-MM Shown only events for the given year/month. |
| 1224 | ** datefmt=N Override the date format |
| 1225 | ** |
| 1226 | ** p= and d= can appear individually or together. If either p= or d= |
| 1227 | ** appear, then u=, y=, a=, and b= are ignored. |
| @@ -1250,10 +1251,11 @@ | |
| 1251 | const char *zUses = P("uf"); /* Only show check-ins hold this file */ |
| 1252 | const char *zYearMonth = P("ym"); /* Show check-ins for the given YYYY-MM */ |
| 1253 | const char *zYearWeek = P("yw"); /* Check-ins for YYYY-WW (week-of-year) */ |
| 1254 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1255 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1256 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1257 | int tagid; /* Tag ID */ |
| 1258 | int tmFlags = 0; /* Timeline flags */ |
| 1259 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| 1260 | const char *zThisUser = 0; /* Suppress links to this user */ |
| 1261 | HQuery url; /* URL for various branch links */ |
| @@ -1356,10 +1358,30 @@ | |
| 1358 | "CREATE TEMP TABLE rnfile(rid INTEGER PRIMARY KEY);" |
| 1359 | "INSERT OR IGNORE INTO rnfile" |
| 1360 | " SELECT mid FROM mlink WHERE pfnid>0 AND pfnid!=fnid;" |
| 1361 | ); |
| 1362 | disableY = 1; |
| 1363 | } |
| 1364 | if( forkOnly ){ |
| 1365 | db_multi_exec( |
| 1366 | "CREATE TEMP TABLE rnfork(rid INTEGER PRIMARY KEY);\n" |
| 1367 | "INSERT OR IGNORE INTO rnfork(rid)\n" |
| 1368 | " SELECT pid FROM plink\n" |
| 1369 | " WHERE (SELECT value FROM tagxref WHERE tagid=%d AND rid=cid)==" |
| 1370 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=pid)\n" |
| 1371 | " GROUP BY pid" |
| 1372 | " HAVING count(*)>1;\n" |
| 1373 | "INSERT OR IGNORE INTO rnfork(rid)" |
| 1374 | " SELECT cid FROM plink\n" |
| 1375 | " WHERE (SELECT value FROM tagxref WHERE tagid=%d AND rid=cid)==" |
| 1376 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=pid)\n" |
| 1377 | " AND pid IN rnfork;", |
| 1378 | TAG_BRANCH, TAG_BRANCH, TAG_BRANCH, TAG_BRANCH |
| 1379 | ); |
| 1380 | tmFlags |= TIMELINE_UNHIDE; |
| 1381 | zType = "ci"; |
| 1382 | disableY = 1; |
| 1383 | } |
| 1384 | |
| 1385 | style_header("Timeline"); |
| 1386 | login_anonymous_available(); |
| 1387 | timeline_temp_table(); |
| @@ -1486,10 +1508,13 @@ | |
| 1508 | blob_append_sql(&sql, " AND event.objid IN usesfile "); |
| 1509 | } |
| 1510 | if( renameOnly ){ |
| 1511 | blob_append_sql(&sql, " AND event.objid IN rnfile "); |
| 1512 | } |
| 1513 | if( forkOnly ){ |
| 1514 | blob_append_sql(&sql, " AND event.objid IN rnfork "); |
| 1515 | } |
| 1516 | if( zYearMonth ){ |
| 1517 | blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%m',event.mtime) ", |
| 1518 | zYearMonth); |
| 1519 | } |
| 1520 | else if( zYearWeek ){ |
| @@ -1658,10 +1683,14 @@ | |
| 1683 | } |
| 1684 | if( renameOnly ){ |
| 1685 | blob_appendf(&desc, " that contain filename changes"); |
| 1686 | tmFlags |= TIMELINE_DISJOINT|TIMELINE_FRENAMES; |
| 1687 | } |
| 1688 | if( forkOnly ){ |
| 1689 | blob_appendf(&desc, " associated with forks"); |
| 1690 | tmFlags |= TIMELINE_DISJOINT; |
| 1691 | } |
| 1692 | if( zUser ){ |
| 1693 | blob_appendf(&desc, " by user %h", zUser); |
| 1694 | tmFlags |= TIMELINE_DISJOINT; |
| 1695 | } |
| 1696 | if( zTagName ){ |
| 1697 |