Fossil SCM

Attempts at improving timeline graphs to be more intuitive and informational. For this check-in, add the TIMELINE_XMERGE property to disable merge lines to non-graph nodes. Then disable TIMELINE_DISJOINT for branch graphs.

drh 2019-05-16 16:19 trunk
Commit f6d74f16777e57cd3a74bd1fe2c3aaf55d9d3f5a5fb684f83cb0387902674f4b
+2 -1
--- src/graph.c
+++ src/graph.c
@@ -378,10 +378,11 @@
378378
** The tmFlags parameter is zero or more of the TIMELINE_* constants.
379379
** Only the following are honored:
380380
**
381381
** TIMELINE_DISJOINT: Omit descenders
382382
** TIMELINE_FILLGAPS: Use step-children
383
+** TIMELINE_XMERGE: Omit off-graph merge lines
383384
*/
384385
void graph_finish(GraphContext *p, u32 tmFlags){
385386
GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
386387
int i, j;
387388
u64 mask;
@@ -421,11 +422,11 @@
421422
** A merge parent is a prior check-in from which changes were merged into
422423
** the current check-in. If a merge parent is not in the visible section
423424
** of this graph, then no arrows will be drawn for it, so remove it from
424425
** the aParent[] array.
425426
*/
426
- if( omitDescenders ){
427
+ if( (tmFlags & (TIMELINE_DISJOINT|TIMELINE_XMERGE))!=0 ){
427428
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
428429
for(i=1; i<pRow->nParent; i++){
429430
if( hashFind(p, pRow->aParent[i])==0 ){
430431
memmove(pRow->aParent+i, pRow->aParent+i+1,
431432
sizeof(pRow->aParent[0])*(pRow->nParent-i-1));
432433
--- src/graph.c
+++ src/graph.c
@@ -378,10 +378,11 @@
378 ** The tmFlags parameter is zero or more of the TIMELINE_* constants.
379 ** Only the following are honored:
380 **
381 ** TIMELINE_DISJOINT: Omit descenders
382 ** TIMELINE_FILLGAPS: Use step-children
 
383 */
384 void graph_finish(GraphContext *p, u32 tmFlags){
385 GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
386 int i, j;
387 u64 mask;
@@ -421,11 +422,11 @@
421 ** A merge parent is a prior check-in from which changes were merged into
422 ** the current check-in. If a merge parent is not in the visible section
423 ** of this graph, then no arrows will be drawn for it, so remove it from
424 ** the aParent[] array.
425 */
426 if( omitDescenders ){
427 for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
428 for(i=1; i<pRow->nParent; i++){
429 if( hashFind(p, pRow->aParent[i])==0 ){
430 memmove(pRow->aParent+i, pRow->aParent+i+1,
431 sizeof(pRow->aParent[0])*(pRow->nParent-i-1));
432
--- src/graph.c
+++ src/graph.c
@@ -378,10 +378,11 @@
378 ** The tmFlags parameter is zero or more of the TIMELINE_* constants.
379 ** Only the following are honored:
380 **
381 ** TIMELINE_DISJOINT: Omit descenders
382 ** TIMELINE_FILLGAPS: Use step-children
383 ** TIMELINE_XMERGE: Omit off-graph merge lines
384 */
385 void graph_finish(GraphContext *p, u32 tmFlags){
386 GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
387 int i, j;
388 u64 mask;
@@ -421,11 +422,11 @@
422 ** A merge parent is a prior check-in from which changes were merged into
423 ** the current check-in. If a merge parent is not in the visible section
424 ** of this graph, then no arrows will be drawn for it, so remove it from
425 ** the aParent[] array.
426 */
427 if( (tmFlags & (TIMELINE_DISJOINT|TIMELINE_XMERGE))!=0 ){
428 for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
429 for(i=1; i<pRow->nParent; i++){
430 if( hashFind(p, pRow->aParent[i])==0 ){
431 memmove(pRow->aParent+i, pRow->aParent+i+1,
432 sizeof(pRow->aParent[0])*(pRow->nParent-i-1));
433
+1
--- src/info.c
+++ src/info.c
@@ -284,10 +284,11 @@
284284
db_prepare(&q, "%s", blob_sql_text(&sql));
285285
www_print_timeline(&q,
286286
TIMELINE_GRAPH
287287
|TIMELINE_FILLGAPS
288288
|TIMELINE_NOSCROLL
289
+ |TIMELINE_XMERGE
289290
|TIMELINE_CHPICK,
290291
0, 0, rid, 0);
291292
db_finalize(&q);
292293
}
293294
294295
--- src/info.c
+++ src/info.c
@@ -284,10 +284,11 @@
284 db_prepare(&q, "%s", blob_sql_text(&sql));
285 www_print_timeline(&q,
286 TIMELINE_GRAPH
287 |TIMELINE_FILLGAPS
288 |TIMELINE_NOSCROLL
 
289 |TIMELINE_CHPICK,
290 0, 0, rid, 0);
291 db_finalize(&q);
292 }
293
294
--- src/info.c
+++ src/info.c
@@ -284,10 +284,11 @@
284 db_prepare(&q, "%s", blob_sql_text(&sql));
285 www_print_timeline(&q,
286 TIMELINE_GRAPH
287 |TIMELINE_FILLGAPS
288 |TIMELINE_NOSCROLL
289 |TIMELINE_XMERGE
290 |TIMELINE_CHPICK,
291 0, 0, rid, 0);
292 db_finalize(&q);
293 }
294
295
+28 -27
--- src/timeline.c
+++ src/timeline.c
@@ -91,32 +91,33 @@
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*/
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 */
103
-#define TIMELINE_UCOLOR 0x000080 /* Background color by user */
104
-#define TIMELINE_FRENAMES 0x000100 /* Detail only file name changes */
105
-#define TIMELINE_UNHIDE 0x000200 /* Unhide check-ins with "hidden" tag */
106
-#define TIMELINE_SHOWRID 0x000400 /* Show RID values in addition to UUIDs */
107
-#define TIMELINE_BISECT 0x000800 /* Show supplimental bisect information */
108
-#define TIMELINE_COMPACT 0x001000 /* Use the "compact" view style */
109
-#define TIMELINE_VERBOSE 0x002000 /* Use the "detailed" view style */
110
-#define TIMELINE_MODERN 0x004000 /* Use the "modern" view style */
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
-#define TIMELINE_FILLGAPS 0x800000 /* Dotted lines for missing nodes */
96
+#define TIMELINE_ARTID 0x0000001 /* Show artifact IDs on non-check-in lines*/
97
+#define TIMELINE_LEAFONLY 0x0000002 /* Show "Leaf" but not "Merge", "Fork" etc*/
98
+#define TIMELINE_BRIEF 0x0000004 /* Combine adjacent elements of same obj */
99
+#define TIMELINE_GRAPH 0x0000008 /* Compute a graph */
100
+#define TIMELINE_DISJOINT 0x0000010 /* Elements are not contiguous */
101
+#define TIMELINE_FCHANGES 0x0000020 /* Detail file changes */
102
+#define TIMELINE_BRCOLOR 0x0000040 /* Background color by branch name */
103
+#define TIMELINE_UCOLOR 0x0000080 /* Background color by user */
104
+#define TIMELINE_FRENAMES 0x0000100 /* Detail only file name changes */
105
+#define TIMELINE_UNHIDE 0x0000200 /* Unhide check-ins with "hidden" tag */
106
+#define TIMELINE_SHOWRID 0x0000400 /* Show RID values in addition to UUIDs */
107
+#define TIMELINE_BISECT 0x0000800 /* Show supplimental bisect information */
108
+#define TIMELINE_COMPACT 0x0001000 /* Use the "compact" view style */
109
+#define TIMELINE_VERBOSE 0x0002000 /* Use the "detailed" view style */
110
+#define TIMELINE_MODERN 0x0004000 /* Use the "modern" view style */
111
+#define TIMELINE_COLUMNAR 0x0008000 /* Use the "columns" view style */
112
+#define TIMELINE_CLASSIC 0x0010000 /* Use the "classic" view style */
113
+#define TIMELINE_VIEWS 0x001f000 /* Mask for all of the view styles */
114
+#define TIMELINE_NOSCROLL 0x0100000 /* Don't scroll to the selection */
115
+#define TIMELINE_FILEDIFF 0x0200000 /* Show File differences, not ckin diffs */
116
+#define TIMELINE_CHPICK 0x0400000 /* Show cherrypick merges */
117
+#define TIMELINE_FILLGAPS 0x0800000 /* Dotted lines for missing nodes */
118
+#define TIMELINE_XMERGE 0x1000000 /* Omit merges from off-graph nodes */
118119
#endif
119120
120121
/*
121122
** Hash a string and use the hash to determine a background color.
122123
*/
@@ -297,12 +298,12 @@
297298
if( (tmFlags & TIMELINE_CHPICK)!=0
298299
&& !db_table_exists("repository","cherrypick")
299300
){
300301
tmFlags &= ~TIMELINE_CHPICK;
301302
}
302
-
303
- @ <table id="timelineTable%d(iTableId)" class="timelineTable">
303
+ @ <table id="timelineTable%d(iTableId)" class="timelineTable"> \
304
+ @ <!-- tmFlags: 0x%x(tmFlags) -->
304305
blob_zero(&comment);
305306
while( db_step(pQuery)==SQLITE_ROW ){
306307
int rid = db_column_int(pQuery, 0);
307308
const char *zUuid = db_column_text(pQuery, 1);
308309
int isLeaf = db_column_int(pQuery, 5);
@@ -1691,12 +1692,12 @@
16911692
tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH | TIMELINE_CHPICK;
16921693
}else{
16931694
tmFlags |= TIMELINE_GRAPH | TIMELINE_CHPICK;
16941695
}
16951696
if( related ){
1696
- tmFlags |= TIMELINE_FILLGAPS;
1697
-// tmFlags &= ~TIMELINE_DISJOINT;
1697
+ tmFlags |= TIMELINE_FILLGAPS | TIMELINE_XMERGE;
1698
+ tmFlags &= ~TIMELINE_DISJOINT;
16981699
}
16991700
if( PB("ncp") ){
17001701
tmFlags &= ~TIMELINE_CHPICK;
17011702
}
17021703
if( PB("ng") || zSearch!=0 ){
@@ -2256,11 +2257,11 @@
22562257
blob_appendf(&desc, " related to tags matching %h", zMatchDesc);
22572258
}else{
22582259
blob_appendf(&desc, " with tags matching %h", zMatchDesc);
22592260
}
22602261
}
2261
- tmFlags |= TIMELINE_DISJOINT;
2262
+ if( !related ) tmFlags |= TIMELINE_DISJOINT;
22622263
}
22632264
addFileGlobDescription(zChng, &desc);
22642265
if( rAfter>0.0 ){
22652266
if( rBefore>0.0 ){
22662267
blob_appendf(&desc, " occurring between %h and %h.<br />",
22672268
--- src/timeline.c
+++ src/timeline.c
@@ -91,32 +91,33 @@
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 */
103 #define TIMELINE_UCOLOR 0x000080 /* Background color by user */
104 #define TIMELINE_FRENAMES 0x000100 /* Detail only file name changes */
105 #define TIMELINE_UNHIDE 0x000200 /* Unhide check-ins with "hidden" tag */
106 #define TIMELINE_SHOWRID 0x000400 /* Show RID values in addition to UUIDs */
107 #define TIMELINE_BISECT 0x000800 /* Show supplimental bisect information */
108 #define TIMELINE_COMPACT 0x001000 /* Use the "compact" view style */
109 #define TIMELINE_VERBOSE 0x002000 /* Use the "detailed" view style */
110 #define TIMELINE_MODERN 0x004000 /* Use the "modern" view style */
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 #define TIMELINE_FILLGAPS 0x800000 /* Dotted lines for missing nodes */
 
118 #endif
119
120 /*
121 ** Hash a string and use the hash to determine a background color.
122 */
@@ -297,12 +298,12 @@
297 if( (tmFlags & TIMELINE_CHPICK)!=0
298 && !db_table_exists("repository","cherrypick")
299 ){
300 tmFlags &= ~TIMELINE_CHPICK;
301 }
302
303 @ <table id="timelineTable%d(iTableId)" class="timelineTable">
304 blob_zero(&comment);
305 while( db_step(pQuery)==SQLITE_ROW ){
306 int rid = db_column_int(pQuery, 0);
307 const char *zUuid = db_column_text(pQuery, 1);
308 int isLeaf = db_column_int(pQuery, 5);
@@ -1691,12 +1692,12 @@
1691 tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH | TIMELINE_CHPICK;
1692 }else{
1693 tmFlags |= TIMELINE_GRAPH | TIMELINE_CHPICK;
1694 }
1695 if( related ){
1696 tmFlags |= TIMELINE_FILLGAPS;
1697 // tmFlags &= ~TIMELINE_DISJOINT;
1698 }
1699 if( PB("ncp") ){
1700 tmFlags &= ~TIMELINE_CHPICK;
1701 }
1702 if( PB("ng") || zSearch!=0 ){
@@ -2256,11 +2257,11 @@
2256 blob_appendf(&desc, " related to tags matching %h", zMatchDesc);
2257 }else{
2258 blob_appendf(&desc, " with tags matching %h", zMatchDesc);
2259 }
2260 }
2261 tmFlags |= TIMELINE_DISJOINT;
2262 }
2263 addFileGlobDescription(zChng, &desc);
2264 if( rAfter>0.0 ){
2265 if( rBefore>0.0 ){
2266 blob_appendf(&desc, " occurring between %h and %h.<br />",
2267
--- src/timeline.c
+++ src/timeline.c
@@ -91,32 +91,33 @@
91
92 /*
93 ** Allowed flags for the tmFlags argument to www_print_timeline
94 */
95 #if INTERFACE
96 #define TIMELINE_ARTID 0x0000001 /* Show artifact IDs on non-check-in lines*/
97 #define TIMELINE_LEAFONLY 0x0000002 /* Show "Leaf" but not "Merge", "Fork" etc*/
98 #define TIMELINE_BRIEF 0x0000004 /* Combine adjacent elements of same obj */
99 #define TIMELINE_GRAPH 0x0000008 /* Compute a graph */
100 #define TIMELINE_DISJOINT 0x0000010 /* Elements are not contiguous */
101 #define TIMELINE_FCHANGES 0x0000020 /* Detail file changes */
102 #define TIMELINE_BRCOLOR 0x0000040 /* Background color by branch name */
103 #define TIMELINE_UCOLOR 0x0000080 /* Background color by user */
104 #define TIMELINE_FRENAMES 0x0000100 /* Detail only file name changes */
105 #define TIMELINE_UNHIDE 0x0000200 /* Unhide check-ins with "hidden" tag */
106 #define TIMELINE_SHOWRID 0x0000400 /* Show RID values in addition to UUIDs */
107 #define TIMELINE_BISECT 0x0000800 /* Show supplimental bisect information */
108 #define TIMELINE_COMPACT 0x0001000 /* Use the "compact" view style */
109 #define TIMELINE_VERBOSE 0x0002000 /* Use the "detailed" view style */
110 #define TIMELINE_MODERN 0x0004000 /* Use the "modern" view style */
111 #define TIMELINE_COLUMNAR 0x0008000 /* Use the "columns" view style */
112 #define TIMELINE_CLASSIC 0x0010000 /* Use the "classic" view style */
113 #define TIMELINE_VIEWS 0x001f000 /* Mask for all of the view styles */
114 #define TIMELINE_NOSCROLL 0x0100000 /* Don't scroll to the selection */
115 #define TIMELINE_FILEDIFF 0x0200000 /* Show File differences, not ckin diffs */
116 #define TIMELINE_CHPICK 0x0400000 /* Show cherrypick merges */
117 #define TIMELINE_FILLGAPS 0x0800000 /* Dotted lines for missing nodes */
118 #define TIMELINE_XMERGE 0x1000000 /* Omit merges from off-graph nodes */
119 #endif
120
121 /*
122 ** Hash a string and use the hash to determine a background color.
123 */
@@ -297,12 +298,12 @@
298 if( (tmFlags & TIMELINE_CHPICK)!=0
299 && !db_table_exists("repository","cherrypick")
300 ){
301 tmFlags &= ~TIMELINE_CHPICK;
302 }
303 @ <table id="timelineTable%d(iTableId)" class="timelineTable"> \
304 @ <!-- tmFlags: 0x%x(tmFlags) -->
305 blob_zero(&comment);
306 while( db_step(pQuery)==SQLITE_ROW ){
307 int rid = db_column_int(pQuery, 0);
308 const char *zUuid = db_column_text(pQuery, 1);
309 int isLeaf = db_column_int(pQuery, 5);
@@ -1691,12 +1692,12 @@
1692 tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH | TIMELINE_CHPICK;
1693 }else{
1694 tmFlags |= TIMELINE_GRAPH | TIMELINE_CHPICK;
1695 }
1696 if( related ){
1697 tmFlags |= TIMELINE_FILLGAPS | TIMELINE_XMERGE;
1698 tmFlags &= ~TIMELINE_DISJOINT;
1699 }
1700 if( PB("ncp") ){
1701 tmFlags &= ~TIMELINE_CHPICK;
1702 }
1703 if( PB("ng") || zSearch!=0 ){
@@ -2256,11 +2257,11 @@
2257 blob_appendf(&desc, " related to tags matching %h", zMatchDesc);
2258 }else{
2259 blob_appendf(&desc, " with tags matching %h", zMatchDesc);
2260 }
2261 }
2262 if( !related ) tmFlags |= TIMELINE_DISJOINT;
2263 }
2264 addFileGlobDescription(zChng, &desc);
2265 if( rAfter>0.0 ){
2266 if( rBefore>0.0 ){
2267 blob_appendf(&desc, " occurring between %h and %h.<br />",
2268

Keyboard Shortcuts

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