Fossil SCM

Add the deltabg query parameter to /timeline.

drh 2020-07-24 12:56 trunk
Commit 6b9d57a04ce5939377e82c6dacad9d0a1fc04094f861dd05d2dc6aff6d8cce2f
1 file changed +29 -5
+29 -5
--- src/timeline.c
+++ src/timeline.c
@@ -117,10 +117,11 @@
117117
#define TIMELINE_FILLGAPS 0x0800000 /* Dotted lines for missing nodes */
118118
#define TIMELINE_XMERGE 0x1000000 /* Omit merges from off-graph nodes */
119119
#define TIMELINE_NOTKT 0x2000000 /* Omit extra ticket classes */
120120
#define TIMELINE_FORUMTXT 0x4000000 /* Render all forum messages */
121121
#define TIMELINE_REFS 0x8000000 /* Output intended for References tab */
122
+#define TIMELINE_DELTA 0x10000000 /* Background color shows delta manifests */
122123
#endif
123124
124125
/*
125126
** Hash a string and use the hash to determine a background color.
126127
*/
@@ -443,23 +444,41 @@
443444
}else{
444445
zDateLink = mprintf("<a>");
445446
}
446447
@ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td>
447448
@ <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
+ }
449467
if( zType[0]=='c'
450
- && (pGraph || zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0)
468
+ && (pGraph || zBgClr==0 || (tmFlags & (TIMELINE_BRCOLOR|TIMELINE_DELTA))!=0)
451469
){
452470
db_reset(&qbranch);
453471
db_bind_int(&qbranch, ":rid", rid);
454472
if( db_step(&qbranch)==SQLITE_ROW ){
455473
zBr = db_column_text(&qbranch, 0);
456474
}else{
457475
zBr = "trunk";
458476
}
459477
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 ){
461480
zBgClr = 0;
462481
}else{
463482
zBgClr = hash_color(zBr);
464483
}
465484
}
@@ -1619,12 +1638,14 @@
16191638
** shortest ... show only the shortest path
16201639
** rel ... also show related checkins
16211640
** uf=FILE_HASH Show only check-ins that contain the given file version
16221641
** chng=GLOBLIST Show only check-ins that involve changes to a file whose
16231642
** 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
16261647
** namechng Show only check-ins that have filename changes
16271648
** forks Show only forks and their children
16281649
** cherrypicks Show all cherrypicks
16291650
** ym=YYYY-MM Show only events for the given year/month
16301651
** yw=YYYY-WW Show only events for the given week of the given year
@@ -1853,10 +1874,13 @@
18531874
tmFlags |= TIMELINE_UNHIDE;
18541875
}
18551876
if( PB("ubg") ){
18561877
tmFlags |= TIMELINE_UCOLOR;
18571878
}
1879
+ if( PB("deltabg") ){
1880
+ tmFlags |= TIMELINE_DELTA;
1881
+ }
18581882
if( zUses!=0 ){
18591883
int ufid = db_int(0, "SELECT rid FROM blob WHERE uuid GLOB '%q*'", zUses);
18601884
if( ufid ){
18611885
zUses = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", ufid);
18621886
db_multi_exec("CREATE TEMP TABLE usesfile(rid INTEGER PRIMARY KEY)");
18631887
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button