Fossil SCM

Draw arrows for cherrypick merges on the context graph. There is still no distinction between normal and cherrypick merges, though. Both arrows look alike.

drh 2018-12-27 15:40 trunk
Commit a07f1688818331268964036d6c128f79f010ab96dd6c42577ecb44aeac876562
2 files changed +6 -2 +20 -2
+6 -2
--- src/info.c
+++ src/info.c
@@ -279,12 +279,16 @@
279279
);
280280
}
281281
}
282282
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
283283
db_prepare(&q, "%s", blob_sql_text(&sql));
284
- www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
285
- 0, 0, rid, 0);
284
+ www_print_timeline(&q,
285
+ TIMELINE_DISJOINT
286
+ |TIMELINE_GRAPH
287
+ |TIMELINE_NOSCROLL
288
+ |TIMELINE_CHPICK,
289
+ 0, 0, rid, 0);
286290
db_finalize(&q);
287291
}
288292
289293
/*
290294
** Show a graph all wiki, tickets, and check-ins that refer to object zUuid.
291295
--- src/info.c
+++ src/info.c
@@ -279,12 +279,16 @@
279 );
280 }
281 }
282 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
283 db_prepare(&q, "%s", blob_sql_text(&sql));
284 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
285 0, 0, rid, 0);
 
 
 
 
286 db_finalize(&q);
287 }
288
289 /*
290 ** Show a graph all wiki, tickets, and check-ins that refer to object zUuid.
291
--- src/info.c
+++ src/info.c
@@ -279,12 +279,16 @@
279 );
280 }
281 }
282 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
283 db_prepare(&q, "%s", blob_sql_text(&sql));
284 www_print_timeline(&q,
285 TIMELINE_DISJOINT
286 |TIMELINE_GRAPH
287 |TIMELINE_NOSCROLL
288 |TIMELINE_CHPICK,
289 0, 0, rid, 0);
290 db_finalize(&q);
291 }
292
293 /*
294 ** Show a graph all wiki, tickets, and check-ins that refer to object zUuid.
295
+20 -2
--- src/timeline.c
+++ src/timeline.c
@@ -91,12 +91,12 @@
9191
9292
/*
9393
** Allowed flags for the tmFlags argument to www_print_timeline
9494
*/
9595
#if INTERFACE
96
-#define TIMELINE_ARTID 0x000001 /* Show artifact IDs on non-check-in lines */
97
-#define TIMELINE_LEAFONLY 0x000002 /* Show "Leaf" but not "Merge", "Fork" etc */
96
+#define TIMELINE_ARTID 0x000001 /* Show artifact IDs on non-check-in lines*/
97
+#define TIMELINE_LEAFONLY 0x000002 /* Show "Leaf" but not "Merge", "Fork" etc*/
9898
#define TIMELINE_BRIEF 0x000004 /* Combine adjacent elements of same obj */
9999
#define TIMELINE_GRAPH 0x000008 /* Compute a graph */
100100
#define TIMELINE_DISJOINT 0x000010 /* Elements are not contiguous */
101101
#define TIMELINE_FCHANGES 0x000020 /* Detail file changes */
102102
#define TIMELINE_BRCOLOR 0x000040 /* Background color by branch name */
@@ -111,10 +111,11 @@
111111
#define TIMELINE_COLUMNAR 0x008000 /* Use the "columns" view style */
112112
#define TIMELINE_CLASSIC 0x010000 /* Use the "classic" view style */
113113
#define TIMELINE_VIEWS 0x01f000 /* Mask for all of the view styles */
114114
#define TIMELINE_NOSCROLL 0x100000 /* Don't scroll to the selection */
115115
#define TIMELINE_FILEDIFF 0x200000 /* Show File differences, not ckin diffs */
116
+#define TIMELINE_CHPICK 0x400000 /* Show cherrypick merges */
116117
#endif
117118
118119
/*
119120
** Hash a string and use the hash to determine a background color.
120121
*/
@@ -290,10 +291,15 @@
290291
}
291292
db_static_prepare(&qbranch,
292293
"SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid",
293294
TAG_BRANCH
294295
);
296
+ if( (tmFlags & TIMELINE_CHPICK)!=0
297
+ && !db_table_exists("repository","cherrypick")
298
+ ){
299
+ tmFlags &= ~TIMELINE_CHPICK;
300
+ }
295301
296302
@ <table id="timelineTable%d(iTableId)" class="timelineTable">
297303
blob_zero(&comment);
298304
while( db_step(pQuery)==SQLITE_ROW ){
299305
int rid = db_column_int(pQuery, 0);
@@ -435,10 +441,22 @@
435441
db_bind_int(&qparent, ":rid", rid);
436442
while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){
437443
aParent[nParent++] = db_column_int(&qparent, 0);
438444
}
439445
db_reset(&qparent);
446
+ if( (tmFlags & TIMELINE_CHPICK)!=0 && nParent>0 ){
447
+ static Stmt qcherrypick;
448
+ db_static_prepare(&qcherrypick,
449
+ "SELECT parentid FROM cherrypick"
450
+ " WHERE childid=:rid AND parentid NOT IN phantom"
451
+ );
452
+ db_bind_int(&qcherrypick, ":rid", rid);
453
+ while( db_step(&qcherrypick)==SQLITE_ROW && nParent<count(aParent) ){
454
+ aParent[nParent++] = db_column_int(&qcherrypick, 0);
455
+ }
456
+ db_reset(&qcherrypick);
457
+ }
440458
gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
441459
zUuid, isLeaf);
442460
db_reset(&qbranch);
443461
@ <div id="m%d(gidx)" class="tl-nodemark"></div>
444462
}else if( zType[0]=='e' && pGraph && zBgClr && zBgClr[0] ){
445463
--- src/timeline.c
+++ src/timeline.c
@@ -91,12 +91,12 @@
91
92 /*
93 ** Allowed flags for the tmFlags argument to www_print_timeline
94 */
95 #if INTERFACE
96 #define TIMELINE_ARTID 0x000001 /* Show artifact IDs on non-check-in lines */
97 #define TIMELINE_LEAFONLY 0x000002 /* Show "Leaf" but not "Merge", "Fork" etc */
98 #define TIMELINE_BRIEF 0x000004 /* Combine adjacent elements of same obj */
99 #define TIMELINE_GRAPH 0x000008 /* Compute a graph */
100 #define TIMELINE_DISJOINT 0x000010 /* Elements are not contiguous */
101 #define TIMELINE_FCHANGES 0x000020 /* Detail file changes */
102 #define TIMELINE_BRCOLOR 0x000040 /* Background color by branch name */
@@ -111,10 +111,11 @@
111 #define TIMELINE_COLUMNAR 0x008000 /* Use the "columns" view style */
112 #define TIMELINE_CLASSIC 0x010000 /* Use the "classic" view style */
113 #define TIMELINE_VIEWS 0x01f000 /* Mask for all of the view styles */
114 #define TIMELINE_NOSCROLL 0x100000 /* Don't scroll to the selection */
115 #define TIMELINE_FILEDIFF 0x200000 /* Show File differences, not ckin diffs */
 
116 #endif
117
118 /*
119 ** Hash a string and use the hash to determine a background color.
120 */
@@ -290,10 +291,15 @@
290 }
291 db_static_prepare(&qbranch,
292 "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid",
293 TAG_BRANCH
294 );
 
 
 
 
 
295
296 @ <table id="timelineTable%d(iTableId)" class="timelineTable">
297 blob_zero(&comment);
298 while( db_step(pQuery)==SQLITE_ROW ){
299 int rid = db_column_int(pQuery, 0);
@@ -435,10 +441,22 @@
435 db_bind_int(&qparent, ":rid", rid);
436 while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){
437 aParent[nParent++] = db_column_int(&qparent, 0);
438 }
439 db_reset(&qparent);
 
 
 
 
 
 
 
 
 
 
 
 
440 gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
441 zUuid, isLeaf);
442 db_reset(&qbranch);
443 @ <div id="m%d(gidx)" class="tl-nodemark"></div>
444 }else if( zType[0]=='e' && pGraph && zBgClr && zBgClr[0] ){
445
--- src/timeline.c
+++ src/timeline.c
@@ -91,12 +91,12 @@
91
92 /*
93 ** Allowed flags for the tmFlags argument to www_print_timeline
94 */
95 #if INTERFACE
96 #define TIMELINE_ARTID 0x000001 /* Show artifact IDs on non-check-in lines*/
97 #define TIMELINE_LEAFONLY 0x000002 /* Show "Leaf" but not "Merge", "Fork" etc*/
98 #define TIMELINE_BRIEF 0x000004 /* Combine adjacent elements of same obj */
99 #define TIMELINE_GRAPH 0x000008 /* Compute a graph */
100 #define TIMELINE_DISJOINT 0x000010 /* Elements are not contiguous */
101 #define TIMELINE_FCHANGES 0x000020 /* Detail file changes */
102 #define TIMELINE_BRCOLOR 0x000040 /* Background color by branch name */
@@ -111,10 +111,11 @@
111 #define TIMELINE_COLUMNAR 0x008000 /* Use the "columns" view style */
112 #define TIMELINE_CLASSIC 0x010000 /* Use the "classic" view style */
113 #define TIMELINE_VIEWS 0x01f000 /* Mask for all of the view styles */
114 #define TIMELINE_NOSCROLL 0x100000 /* Don't scroll to the selection */
115 #define TIMELINE_FILEDIFF 0x200000 /* Show File differences, not ckin diffs */
116 #define TIMELINE_CHPICK 0x400000 /* Show cherrypick merges */
117 #endif
118
119 /*
120 ** Hash a string and use the hash to determine a background color.
121 */
@@ -290,10 +291,15 @@
291 }
292 db_static_prepare(&qbranch,
293 "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid",
294 TAG_BRANCH
295 );
296 if( (tmFlags & TIMELINE_CHPICK)!=0
297 && !db_table_exists("repository","cherrypick")
298 ){
299 tmFlags &= ~TIMELINE_CHPICK;
300 }
301
302 @ <table id="timelineTable%d(iTableId)" class="timelineTable">
303 blob_zero(&comment);
304 while( db_step(pQuery)==SQLITE_ROW ){
305 int rid = db_column_int(pQuery, 0);
@@ -435,10 +441,22 @@
441 db_bind_int(&qparent, ":rid", rid);
442 while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){
443 aParent[nParent++] = db_column_int(&qparent, 0);
444 }
445 db_reset(&qparent);
446 if( (tmFlags & TIMELINE_CHPICK)!=0 && nParent>0 ){
447 static Stmt qcherrypick;
448 db_static_prepare(&qcherrypick,
449 "SELECT parentid FROM cherrypick"
450 " WHERE childid=:rid AND parentid NOT IN phantom"
451 );
452 db_bind_int(&qcherrypick, ":rid", rid);
453 while( db_step(&qcherrypick)==SQLITE_ROW && nParent<count(aParent) ){
454 aParent[nParent++] = db_column_int(&qcherrypick, 0);
455 }
456 db_reset(&qcherrypick);
457 }
458 gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
459 zUuid, isLeaf);
460 db_reset(&qbranch);
461 @ <div id="m%d(gidx)" class="tl-nodemark"></div>
462 }else if( zType[0]=='e' && pGraph && zBgClr && zBgClr[0] ){
463

Keyboard Shortcuts

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