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.
Commit
a388e9da2e292647f5de9a681013630c57dd74bd
Parent
4f24addea90ae08…
1 file changed
+3
-3
+3
-3
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -484,15 +484,15 @@ | ||
| 484 | 484 | blob_appendf(&sql, " AND event.objid IN ok"); |
| 485 | 485 | nd = 0; |
| 486 | 486 | if( d_rid ){ |
| 487 | 487 | compute_descendants(d_rid, nEntry+1); |
| 488 | 488 | nd = db_int(0, "SELECT count(*)-1 FROM ok"); |
| 489 | - if( nd>0 ){ | |
| 489 | + if( nd>=0 ){ | |
| 490 | 490 | 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"); | |
| 492 | 492 | } |
| 493 | - timeline_add_dividers( | |
| 493 | + timeline_add_dividers( | |
| 494 | 494 | db_text("1","SELECT datetime(mtime,'localtime') FROM event" |
| 495 | 495 | " WHERE objid=%d", d_rid) |
| 496 | 496 | ); |
| 497 | 497 | db_multi_exec("DELETE FROM ok"); |
| 498 | 498 | } |
| 499 | 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 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 |