Fossil SCM
Add the deltabg query parameter to /timeline.
Commit
6b9d57a04ce5939377e82c6dacad9d0a1fc04094f861dd05d2dc6aff6d8cce2f
Parent
6dc17a57600e8b4…
1 file changed
+29
-5
+29
-5
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -117,10 +117,11 @@ | ||
| 117 | 117 | #define TIMELINE_FILLGAPS 0x0800000 /* Dotted lines for missing nodes */ |
| 118 | 118 | #define TIMELINE_XMERGE 0x1000000 /* Omit merges from off-graph nodes */ |
| 119 | 119 | #define TIMELINE_NOTKT 0x2000000 /* Omit extra ticket classes */ |
| 120 | 120 | #define TIMELINE_FORUMTXT 0x4000000 /* Render all forum messages */ |
| 121 | 121 | #define TIMELINE_REFS 0x8000000 /* Output intended for References tab */ |
| 122 | +#define TIMELINE_DELTA 0x10000000 /* Background color shows delta manifests */ | |
| 122 | 123 | #endif |
| 123 | 124 | |
| 124 | 125 | /* |
| 125 | 126 | ** Hash a string and use the hash to determine a background color. |
| 126 | 127 | */ |
| @@ -443,23 +444,41 @@ | ||
| 443 | 444 | }else{ |
| 444 | 445 | zDateLink = mprintf("<a>"); |
| 445 | 446 | } |
| 446 | 447 | @ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td> |
| 447 | 448 | @ <td class="timelineGraph"> |
| 448 | - if( tmFlags & TIMELINE_UCOLOR ) zBgClr = zUser ? hash_color(zUser) : 0; | |
| 449 | + if( tmFlags & (TIMELINE_UCOLOR|TIMELINE_DELTA) ){ | |
| 450 | + if( tmFlags & TIMELINE_UCOLOR ){ | |
| 451 | + zBgClr = zUser ? hash_color(zUser) : 0; | |
| 452 | + }else if( zType[0]=='c' ){ | |
| 453 | + static Stmt qdelta; | |
| 454 | + db_static_prepare(&qdelta, "SELECT baseid IS NULL FROM plink" | |
| 455 | + " WHERE cid=:rid"); | |
| 456 | + db_bind_int(&qdelta, ":rid", rid); | |
| 457 | + if( db_step(&qdelta)!=SQLITE_ROW ){ | |
| 458 | + zBgClr = 0; /* Not a check-in */ | |
| 459 | + }else if( db_column_int(&qdelta, 0) ){ | |
| 460 | + zBgClr = hash_color("b"); /* baseline manifest */ | |
| 461 | + }else{ | |
| 462 | + zBgClr = hash_color("f"); /* delta manifest */ | |
| 463 | + } | |
| 464 | + db_reset(&qdelta); | |
| 465 | + } | |
| 466 | + } | |
| 449 | 467 | if( zType[0]=='c' |
| 450 | - && (pGraph || zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0) | |
| 468 | + && (pGraph || zBgClr==0 || (tmFlags & (TIMELINE_BRCOLOR|TIMELINE_DELTA))!=0) | |
| 451 | 469 | ){ |
| 452 | 470 | db_reset(&qbranch); |
| 453 | 471 | db_bind_int(&qbranch, ":rid", rid); |
| 454 | 472 | if( db_step(&qbranch)==SQLITE_ROW ){ |
| 455 | 473 | zBr = db_column_text(&qbranch, 0); |
| 456 | 474 | }else{ |
| 457 | 475 | zBr = "trunk"; |
| 458 | 476 | } |
| 459 | 477 | if( zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0 ){ |
| 460 | - if( zBr==0 || strcmp(zBr,"trunk")==0 ){ | |
| 478 | + if( tmFlags & TIMELINE_DELTA ){ | |
| 479 | + }else if( zBr==0 || strcmp(zBr,"trunk")==0 ){ | |
| 461 | 480 | zBgClr = 0; |
| 462 | 481 | }else{ |
| 463 | 482 | zBgClr = hash_color(zBr); |
| 464 | 483 | } |
| 465 | 484 | } |
| @@ -1619,12 +1638,14 @@ | ||
| 1619 | 1638 | ** shortest ... show only the shortest path |
| 1620 | 1639 | ** rel ... also show related checkins |
| 1621 | 1640 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| 1622 | 1641 | ** chng=GLOBLIST Show only check-ins that involve changes to a file whose |
| 1623 | 1642 | ** name matches one of the comma-separate GLOBLIST |
| 1624 | -** brbg Background color from branch name | |
| 1625 | -** ubg Background color from user | |
| 1643 | +** brbg Background color determined by branch name | |
| 1644 | +** ubg Background color determined by user | |
| 1645 | +** deltabg Background color red for delta manifests or green | |
| 1646 | +** for baseline manifests | |
| 1626 | 1647 | ** namechng Show only check-ins that have filename changes |
| 1627 | 1648 | ** forks Show only forks and their children |
| 1628 | 1649 | ** cherrypicks Show all cherrypicks |
| 1629 | 1650 | ** ym=YYYY-MM Show only events for the given year/month |
| 1630 | 1651 | ** yw=YYYY-WW Show only events for the given week of the given year |
| @@ -1853,10 +1874,13 @@ | ||
| 1853 | 1874 | tmFlags |= TIMELINE_UNHIDE; |
| 1854 | 1875 | } |
| 1855 | 1876 | if( PB("ubg") ){ |
| 1856 | 1877 | tmFlags |= TIMELINE_UCOLOR; |
| 1857 | 1878 | } |
| 1879 | + if( PB("deltabg") ){ | |
| 1880 | + tmFlags |= TIMELINE_DELTA; | |
| 1881 | + } | |
| 1858 | 1882 | if( zUses!=0 ){ |
| 1859 | 1883 | int ufid = db_int(0, "SELECT rid FROM blob WHERE uuid GLOB '%q*'", zUses); |
| 1860 | 1884 | if( ufid ){ |
| 1861 | 1885 | zUses = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", ufid); |
| 1862 | 1886 | db_multi_exec("CREATE TEMP TABLE usesfile(rid INTEGER PRIMARY KEY)"); |
| 1863 | 1887 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -117,10 +117,11 @@ | |
| 117 | #define TIMELINE_FILLGAPS 0x0800000 /* Dotted lines for missing nodes */ |
| 118 | #define TIMELINE_XMERGE 0x1000000 /* Omit merges from off-graph nodes */ |
| 119 | #define TIMELINE_NOTKT 0x2000000 /* Omit extra ticket classes */ |
| 120 | #define TIMELINE_FORUMTXT 0x4000000 /* Render all forum messages */ |
| 121 | #define TIMELINE_REFS 0x8000000 /* Output intended for References tab */ |
| 122 | #endif |
| 123 | |
| 124 | /* |
| 125 | ** Hash a string and use the hash to determine a background color. |
| 126 | */ |
| @@ -443,23 +444,41 @@ | |
| 443 | }else{ |
| 444 | zDateLink = mprintf("<a>"); |
| 445 | } |
| 446 | @ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td> |
| 447 | @ <td class="timelineGraph"> |
| 448 | if( tmFlags & TIMELINE_UCOLOR ) zBgClr = zUser ? hash_color(zUser) : 0; |
| 449 | if( zType[0]=='c' |
| 450 | && (pGraph || zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0) |
| 451 | ){ |
| 452 | db_reset(&qbranch); |
| 453 | db_bind_int(&qbranch, ":rid", rid); |
| 454 | if( db_step(&qbranch)==SQLITE_ROW ){ |
| 455 | zBr = db_column_text(&qbranch, 0); |
| 456 | }else{ |
| 457 | zBr = "trunk"; |
| 458 | } |
| 459 | if( zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0 ){ |
| 460 | if( zBr==0 || strcmp(zBr,"trunk")==0 ){ |
| 461 | zBgClr = 0; |
| 462 | }else{ |
| 463 | zBgClr = hash_color(zBr); |
| 464 | } |
| 465 | } |
| @@ -1619,12 +1638,14 @@ | |
| 1619 | ** shortest ... show only the shortest path |
| 1620 | ** rel ... also show related checkins |
| 1621 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| 1622 | ** chng=GLOBLIST Show only check-ins that involve changes to a file whose |
| 1623 | ** name matches one of the comma-separate GLOBLIST |
| 1624 | ** brbg Background color from branch name |
| 1625 | ** ubg Background color from user |
| 1626 | ** namechng Show only check-ins that have filename changes |
| 1627 | ** forks Show only forks and their children |
| 1628 | ** cherrypicks Show all cherrypicks |
| 1629 | ** ym=YYYY-MM Show only events for the given year/month |
| 1630 | ** yw=YYYY-WW Show only events for the given week of the given year |
| @@ -1853,10 +1874,13 @@ | |
| 1853 | tmFlags |= TIMELINE_UNHIDE; |
| 1854 | } |
| 1855 | if( PB("ubg") ){ |
| 1856 | tmFlags |= TIMELINE_UCOLOR; |
| 1857 | } |
| 1858 | if( zUses!=0 ){ |
| 1859 | int ufid = db_int(0, "SELECT rid FROM blob WHERE uuid GLOB '%q*'", zUses); |
| 1860 | if( ufid ){ |
| 1861 | zUses = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", ufid); |
| 1862 | db_multi_exec("CREATE TEMP TABLE usesfile(rid INTEGER PRIMARY KEY)"); |
| 1863 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -117,10 +117,11 @@ | |
| 117 | #define TIMELINE_FILLGAPS 0x0800000 /* Dotted lines for missing nodes */ |
| 118 | #define TIMELINE_XMERGE 0x1000000 /* Omit merges from off-graph nodes */ |
| 119 | #define TIMELINE_NOTKT 0x2000000 /* Omit extra ticket classes */ |
| 120 | #define TIMELINE_FORUMTXT 0x4000000 /* Render all forum messages */ |
| 121 | #define TIMELINE_REFS 0x8000000 /* Output intended for References tab */ |
| 122 | #define TIMELINE_DELTA 0x10000000 /* Background color shows delta manifests */ |
| 123 | #endif |
| 124 | |
| 125 | /* |
| 126 | ** Hash a string and use the hash to determine a background color. |
| 127 | */ |
| @@ -443,23 +444,41 @@ | |
| 444 | }else{ |
| 445 | zDateLink = mprintf("<a>"); |
| 446 | } |
| 447 | @ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td> |
| 448 | @ <td class="timelineGraph"> |
| 449 | if( tmFlags & (TIMELINE_UCOLOR|TIMELINE_DELTA) ){ |
| 450 | if( tmFlags & TIMELINE_UCOLOR ){ |
| 451 | zBgClr = zUser ? hash_color(zUser) : 0; |
| 452 | }else if( zType[0]=='c' ){ |
| 453 | static Stmt qdelta; |
| 454 | db_static_prepare(&qdelta, "SELECT baseid IS NULL FROM plink" |
| 455 | " WHERE cid=:rid"); |
| 456 | db_bind_int(&qdelta, ":rid", rid); |
| 457 | if( db_step(&qdelta)!=SQLITE_ROW ){ |
| 458 | zBgClr = 0; /* Not a check-in */ |
| 459 | }else if( db_column_int(&qdelta, 0) ){ |
| 460 | zBgClr = hash_color("b"); /* baseline manifest */ |
| 461 | }else{ |
| 462 | zBgClr = hash_color("f"); /* delta manifest */ |
| 463 | } |
| 464 | db_reset(&qdelta); |
| 465 | } |
| 466 | } |
| 467 | if( zType[0]=='c' |
| 468 | && (pGraph || zBgClr==0 || (tmFlags & (TIMELINE_BRCOLOR|TIMELINE_DELTA))!=0) |
| 469 | ){ |
| 470 | db_reset(&qbranch); |
| 471 | db_bind_int(&qbranch, ":rid", rid); |
| 472 | if( db_step(&qbranch)==SQLITE_ROW ){ |
| 473 | zBr = db_column_text(&qbranch, 0); |
| 474 | }else{ |
| 475 | zBr = "trunk"; |
| 476 | } |
| 477 | if( zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0 ){ |
| 478 | if( tmFlags & TIMELINE_DELTA ){ |
| 479 | }else if( zBr==0 || strcmp(zBr,"trunk")==0 ){ |
| 480 | zBgClr = 0; |
| 481 | }else{ |
| 482 | zBgClr = hash_color(zBr); |
| 483 | } |
| 484 | } |
| @@ -1619,12 +1638,14 @@ | |
| 1638 | ** shortest ... show only the shortest path |
| 1639 | ** rel ... also show related checkins |
| 1640 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| 1641 | ** chng=GLOBLIST Show only check-ins that involve changes to a file whose |
| 1642 | ** name matches one of the comma-separate GLOBLIST |
| 1643 | ** brbg Background color determined by branch name |
| 1644 | ** ubg Background color determined by user |
| 1645 | ** deltabg Background color red for delta manifests or green |
| 1646 | ** for baseline manifests |
| 1647 | ** namechng Show only check-ins that have filename changes |
| 1648 | ** forks Show only forks and their children |
| 1649 | ** cherrypicks Show all cherrypicks |
| 1650 | ** ym=YYYY-MM Show only events for the given year/month |
| 1651 | ** yw=YYYY-WW Show only events for the given week of the given year |
| @@ -1853,10 +1874,13 @@ | |
| 1874 | tmFlags |= TIMELINE_UNHIDE; |
| 1875 | } |
| 1876 | if( PB("ubg") ){ |
| 1877 | tmFlags |= TIMELINE_UCOLOR; |
| 1878 | } |
| 1879 | if( PB("deltabg") ){ |
| 1880 | tmFlags |= TIMELINE_DELTA; |
| 1881 | } |
| 1882 | if( zUses!=0 ){ |
| 1883 | int ufid = db_int(0, "SELECT rid FROM blob WHERE uuid GLOB '%q*'", zUses); |
| 1884 | if( ufid ){ |
| 1885 | zUses = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", ufid); |
| 1886 | db_multi_exec("CREATE TEMP TABLE usesfile(rid INTEGER PRIMARY KEY)"); |
| 1887 |