Fossil SCM

timeline descendants view now properly behaves when there are no descendents, and it also sigularizes the word 'descendents' when there is only one.

stephan 2009-12-26 13:43 trunk
Commit a388e9da2e292647f5de9a681013630c57dd74bd
1 file changed +3 -3
+3 -3
--- src/timeline.c
+++ src/timeline.c
@@ -484,15 +484,15 @@
484484
blob_appendf(&sql, " AND event.objid IN ok");
485485
nd = 0;
486486
if( d_rid ){
487487
compute_descendants(d_rid, nEntry+1);
488488
nd = db_int(0, "SELECT count(*)-1 FROM ok");
489
- if( nd>0 ){
489
+ if( nd>=0 ){
490490
db_multi_exec("%s", blob_str(&sql));
491
- blob_appendf(&desc, "%d descendants", nd);
491
+ blob_appendf(&desc, "%d descendant%s", nd,(1==nd)?"":"s");
492492
}
493
- timeline_add_dividers(
493
+ timeline_add_dividers(
494494
db_text("1","SELECT datetime(mtime,'localtime') FROM event"
495495
" WHERE objid=%d", d_rid)
496496
);
497497
db_multi_exec("DELETE FROM ok");
498498
}
499499
--- src/timeline.c
+++ src/timeline.c
@@ -484,15 +484,15 @@
484 blob_appendf(&sql, " AND event.objid IN ok");
485 nd = 0;
486 if( d_rid ){
487 compute_descendants(d_rid, nEntry+1);
488 nd = db_int(0, "SELECT count(*)-1 FROM ok");
489 if( nd>0 ){
490 db_multi_exec("%s", blob_str(&sql));
491 blob_appendf(&desc, "%d descendants", nd);
492 }
493 timeline_add_dividers(
494 db_text("1","SELECT datetime(mtime,'localtime') FROM event"
495 " WHERE objid=%d", d_rid)
496 );
497 db_multi_exec("DELETE FROM ok");
498 }
499
--- src/timeline.c
+++ src/timeline.c
@@ -484,15 +484,15 @@
484 blob_appendf(&sql, " AND event.objid IN ok");
485 nd = 0;
486 if( d_rid ){
487 compute_descendants(d_rid, nEntry+1);
488 nd = db_int(0, "SELECT count(*)-1 FROM ok");
489 if( nd>=0 ){
490 db_multi_exec("%s", blob_str(&sql));
491 blob_appendf(&desc, "%d descendant%s", nd,(1==nd)?"":"s");
492 }
493 timeline_add_dividers(
494 db_text("1","SELECT datetime(mtime,'localtime') FROM event"
495 " WHERE objid=%d", d_rid)
496 );
497 db_multi_exec("DELETE FROM ok");
498 }
499

Keyboard Shortcuts

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