Fossil SCM

Revise and partially revert [d28f9e99a0] and [f174bfa157]: no need to remove the parents, TIMELINE_DISJOINT already does the magic. Related nodes now again have connecting rails for the /leaves, /brtimeline, and /tagtimeline web pages.

florian 2018-12-24 20:54 UTC fix-timeline-view
Commit 8f4b7e1f37060f259c1f5c61ddd737fcd60faee6706d3b9cbf734eb64cb159fb
+3 -4
--- src/branch.c
+++ src/branch.c
@@ -639,14 +639,13 @@
639639
"%s AND blob.rid IN (SELECT rid FROM tagxref"
640640
" WHERE tagtype>0 AND tagid=%d AND srcid!=0)"
641641
" ORDER BY event.mtime DESC",
642642
timeline_query_for_www(), TAG_BRANCH
643643
);
644
- /* With TIMELINE_LEAFONLY (which also implies TIMELINE_DISJOINT), the branch
645
- ** background colors are shown, and the timeline nodes are drawn, but the
646
- ** connecting rails are omitted. */
647
- tmFlags = TIMELINE_LEAFONLY | TIMELINE_NOSCROLL;
644
+ /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
645
+ ** many descenders to (off-screen) parents. */
646
+ tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
648647
if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
649648
if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
650649
if( P("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
651650
www_print_timeline(&q, tmFlags, 0, 0, 0, brtimeline_extra);
652651
db_finalize(&q);
653652
--- src/branch.c
+++ src/branch.c
@@ -639,14 +639,13 @@
639 "%s AND blob.rid IN (SELECT rid FROM tagxref"
640 " WHERE tagtype>0 AND tagid=%d AND srcid!=0)"
641 " ORDER BY event.mtime DESC",
642 timeline_query_for_www(), TAG_BRANCH
643 );
644 /* With TIMELINE_LEAFONLY (which also implies TIMELINE_DISJOINT), the branch
645 ** background colors are shown, and the timeline nodes are drawn, but the
646 ** connecting rails are omitted. */
647 tmFlags = TIMELINE_LEAFONLY | TIMELINE_NOSCROLL;
648 if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
649 if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
650 if( P("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
651 www_print_timeline(&q, tmFlags, 0, 0, 0, brtimeline_extra);
652 db_finalize(&q);
653
--- src/branch.c
+++ src/branch.c
@@ -639,14 +639,13 @@
639 "%s AND blob.rid IN (SELECT rid FROM tagxref"
640 " WHERE tagtype>0 AND tagid=%d AND srcid!=0)"
641 " ORDER BY event.mtime DESC",
642 timeline_query_for_www(), TAG_BRANCH
643 );
644 /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
645 ** many descenders to (off-screen) parents. */
646 tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
 
647 if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
648 if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
649 if( P("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
650 www_print_timeline(&q, tmFlags, 0, 0, 0, brtimeline_extra);
651 db_finalize(&q);
652
--- src/descendants.c
+++ src/descendants.c
@@ -534,11 +534,13 @@
534534
}else if( !showAll ){
535535
blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
536536
}
537537
db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
538538
blob_reset(&sql);
539
- tmFlags = TIMELINE_LEAFONLY | TIMELINE_NOSCROLL;
539
+ /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
540
+ ** many descenders to (off-screen) parents. */
541
+ tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
540542
if( fNg==0 ) tmFlags |= TIMELINE_GRAPH;
541543
if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
542544
if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
543545
www_print_timeline(&q, tmFlags, 0, 0, 0, 0);
544546
db_finalize(&q);
545547
--- src/descendants.c
+++ src/descendants.c
@@ -534,11 +534,13 @@
534 }else if( !showAll ){
535 blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
536 }
537 db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
538 blob_reset(&sql);
539 tmFlags = TIMELINE_LEAFONLY | TIMELINE_NOSCROLL;
 
 
540 if( fNg==0 ) tmFlags |= TIMELINE_GRAPH;
541 if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
542 if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
543 www_print_timeline(&q, tmFlags, 0, 0, 0, 0);
544 db_finalize(&q);
545
--- src/descendants.c
+++ src/descendants.c
@@ -534,11 +534,13 @@
534 }else if( !showAll ){
535 blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
536 }
537 db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
538 blob_reset(&sql);
539 /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
540 ** many descenders to (off-screen) parents. */
541 tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
542 if( fNg==0 ) tmFlags |= TIMELINE_GRAPH;
543 if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
544 if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
545 www_print_timeline(&q, tmFlags, 0, 0, 0, 0);
546 db_finalize(&q);
547
+3 -4
--- src/tag.c
+++ src/tag.c
@@ -713,14 +713,13 @@
713713
" AND tagid IN (SELECT tagid FROM tag "
714714
" WHERE tagname GLOB 'sym-*'))"
715715
" ORDER BY event.mtime DESC /*sort*/",
716716
timeline_query_for_www()
717717
);
718
- /* With TIMELINE_LEAFONLY (which also implies TIMELINE_DISJOINT), the branch
719
- ** background colors are shown, and the timeline nodes are drawn, but the
720
- ** connecting rails are omitted. */
721
- tmFlags = TIMELINE_LEAFONLY | TIMELINE_NOSCROLL;
718
+ /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
719
+ ** many descenders to (off-screen) parents. */
720
+ tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
722721
if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
723722
if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
724723
if( P("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
725724
www_print_timeline(&q, tmFlags, 0, 0, 0, 0);
726725
db_finalize(&q);
727726
--- src/tag.c
+++ src/tag.c
@@ -713,14 +713,13 @@
713 " AND tagid IN (SELECT tagid FROM tag "
714 " WHERE tagname GLOB 'sym-*'))"
715 " ORDER BY event.mtime DESC /*sort*/",
716 timeline_query_for_www()
717 );
718 /* With TIMELINE_LEAFONLY (which also implies TIMELINE_DISJOINT), the branch
719 ** background colors are shown, and the timeline nodes are drawn, but the
720 ** connecting rails are omitted. */
721 tmFlags = TIMELINE_LEAFONLY | TIMELINE_NOSCROLL;
722 if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
723 if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
724 if( P("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
725 www_print_timeline(&q, tmFlags, 0, 0, 0, 0);
726 db_finalize(&q);
727
--- src/tag.c
+++ src/tag.c
@@ -713,14 +713,13 @@
713 " AND tagid IN (SELECT tagid FROM tag "
714 " WHERE tagname GLOB 'sym-*'))"
715 " ORDER BY event.mtime DESC /*sort*/",
716 timeline_query_for_www()
717 );
718 /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
719 ** many descenders to (off-screen) parents. */
720 tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
 
721 if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
722 if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
723 if( P("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
724 www_print_timeline(&q, tmFlags, 0, 0, 0, 0);
725 db_finalize(&q);
726
+16 -27
--- src/timeline.c
+++ src/timeline.c
@@ -286,15 +286,10 @@
286286
zDateFmt = P("datefmt");
287287
if( zDateFmt ) dateFormat = atoi(zDateFmt);
288288
if( tmFlags & TIMELINE_GRAPH ){
289289
pGraph = graph_init();
290290
}
291
- /* Always combine TIMELINE_LEAFONLY with TIMELINE_DISJOINT, or graph_finish()
292
- ** may fail because of too many descenders to (off-screen) parents. */
293
- if( tmFlags & TIMELINE_LEAFONLY ){
294
- tmFlags |= TIMELINE_DISJOINT;
295
- }
296291
db_static_prepare(&qbranch,
297292
"SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid",
298293
TAG_BRANCH
299294
);
300295
@@ -427,32 +422,26 @@
427422
zBgClr = hash_color(zBr);
428423
}
429424
}
430425
}
431426
if( zType[0]=='c' && pGraph ){
432
- if( (tmFlags & TIMELINE_LEAFONLY)==0 ){
433
- int nParent = 0;
434
- int aParent[GR_MAX_RAIL];
435
- static Stmt qparent;
436
- db_static_prepare(&qparent,
437
- "SELECT pid FROM plink"
438
- " WHERE cid=:rid AND pid NOT IN phantom"
439
- " ORDER BY isprim DESC /*sort*/"
440
- );
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
- gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
447
- zUuid, isLeaf);
448
- db_reset(&qbranch);
449
- }else{
450
- /* Omit parents if TIMELINE_LEAFONLY is set. */
451
- gidx = graph_add_row(pGraph, rid, 0, 0, zBr, zBgClr,
452
- zUuid, isLeaf);
453
- }
427
+ int nParent = 0;
428
+ int aParent[GR_MAX_RAIL];
429
+ static Stmt qparent;
430
+ db_static_prepare(&qparent,
431
+ "SELECT pid FROM plink"
432
+ " WHERE cid=:rid AND pid NOT IN phantom"
433
+ " ORDER BY isprim DESC /*sort*/"
434
+ );
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);
454443
@ <div id="m%d(gidx)" class="tl-nodemark"></div>
455444
}else if( zType[0]=='e' && pGraph && zBgClr && zBgClr[0] ){
456445
/* For technotes, make a graph node with nParent==(-1). This will
457446
** not actually draw anything on the graph, but it will set the
458447
** background color of the timeline entry */
459448
--- src/timeline.c
+++ src/timeline.c
@@ -286,15 +286,10 @@
286 zDateFmt = P("datefmt");
287 if( zDateFmt ) dateFormat = atoi(zDateFmt);
288 if( tmFlags & TIMELINE_GRAPH ){
289 pGraph = graph_init();
290 }
291 /* Always combine TIMELINE_LEAFONLY with TIMELINE_DISJOINT, or graph_finish()
292 ** may fail because of too many descenders to (off-screen) parents. */
293 if( tmFlags & TIMELINE_LEAFONLY ){
294 tmFlags |= TIMELINE_DISJOINT;
295 }
296 db_static_prepare(&qbranch,
297 "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=:rid",
298 TAG_BRANCH
299 );
300
@@ -427,32 +422,26 @@
427 zBgClr = hash_color(zBr);
428 }
429 }
430 }
431 if( zType[0]=='c' && pGraph ){
432 if( (tmFlags & TIMELINE_LEAFONLY)==0 ){
433 int nParent = 0;
434 int aParent[GR_MAX_RAIL];
435 static Stmt qparent;
436 db_static_prepare(&qparent,
437 "SELECT pid FROM plink"
438 " WHERE cid=:rid AND pid NOT IN phantom"
439 " ORDER BY isprim DESC /*sort*/"
440 );
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 gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
447 zUuid, isLeaf);
448 db_reset(&qbranch);
449 }else{
450 /* Omit parents if TIMELINE_LEAFONLY is set. */
451 gidx = graph_add_row(pGraph, rid, 0, 0, zBr, zBgClr,
452 zUuid, isLeaf);
453 }
454 @ <div id="m%d(gidx)" class="tl-nodemark"></div>
455 }else if( zType[0]=='e' && pGraph && zBgClr && zBgClr[0] ){
456 /* For technotes, make a graph node with nParent==(-1). This will
457 ** not actually draw anything on the graph, but it will set the
458 ** background color of the timeline entry */
459
--- src/timeline.c
+++ src/timeline.c
@@ -286,15 +286,10 @@
286 zDateFmt = P("datefmt");
287 if( zDateFmt ) dateFormat = atoi(zDateFmt);
288 if( tmFlags & TIMELINE_GRAPH ){
289 pGraph = graph_init();
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
@@ -427,32 +422,26 @@
422 zBgClr = hash_color(zBr);
423 }
424 }
425 }
426 if( zType[0]=='c' && pGraph ){
427 int nParent = 0;
428 int aParent[GR_MAX_RAIL];
429 static Stmt qparent;
430 db_static_prepare(&qparent,
431 "SELECT pid FROM plink"
432 " WHERE cid=:rid AND pid NOT IN phantom"
433 " ORDER BY isprim DESC /*sort*/"
434 );
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 /* For technotes, make a graph node with nParent==(-1). This will
446 ** not actually draw anything on the graph, but it will set the
447 ** background color of the timeline entry */
448

Keyboard Shortcuts

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