Fossil SCM

Make the command-line timeline behave more like the timeline page by handling dates before resolving to symbolic rid which might actually not meet the "before" or "after" criteria. Bug reported by Roy Keene: timeline output always included a timeline entry which happened to be before the "after" date indicated.

andybradford 2017-06-29 06:29 trunk
Commit 048738b282881f068e7f770d8e83e48d05392c4331cd75932fa542e4ba91e479
1 file changed +3 -3
+3 -3
--- src/timeline.c
+++ src/timeline.c
@@ -2447,22 +2447,22 @@
24472447
if( !g.localOpen ){
24482448
fossil_fatal("must be within a local checkout to use 'current'");
24492449
}
24502450
objid = db_lget_int("checkout",0);
24512451
zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid);
2452
- }else if( name_to_uuid(&uuid, 0, "*")==0 ){
2453
- objid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid);
2454
- zDate = mprintf("(SELECT mtime FROM event WHERE objid=%d)", objid);
24552452
}else if( fossil_is_julianday(zOrigin) ){
24562453
const char *zShift = "";
24572454
if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
24582455
fossil_fatal("cannot compute descendants or ancestors of a date");
24592456
}
24602457
if( mode==TIMELINE_MODE_NONE ){
24612458
if( isIsoDate(zOrigin) ) zShift = ",'+1 day'";
24622459
}
24632460
zDate = mprintf("(SELECT julianday(%Q%s, fromLocal()))", zOrigin, zShift);
2461
+ }else if( name_to_uuid(&uuid, 0, "*")==0 ){
2462
+ objid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid);
2463
+ zDate = mprintf("(SELECT mtime FROM event WHERE objid=%d)", objid);
24642464
}else{
24652465
fossil_fatal("unknown check-in or invalid date: %s", zOrigin);
24662466
}
24672467
24682468
if( zFilePattern ){
24692469
--- src/timeline.c
+++ src/timeline.c
@@ -2447,22 +2447,22 @@
2447 if( !g.localOpen ){
2448 fossil_fatal("must be within a local checkout to use 'current'");
2449 }
2450 objid = db_lget_int("checkout",0);
2451 zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid);
2452 }else if( name_to_uuid(&uuid, 0, "*")==0 ){
2453 objid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid);
2454 zDate = mprintf("(SELECT mtime FROM event WHERE objid=%d)", objid);
2455 }else if( fossil_is_julianday(zOrigin) ){
2456 const char *zShift = "";
2457 if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
2458 fossil_fatal("cannot compute descendants or ancestors of a date");
2459 }
2460 if( mode==TIMELINE_MODE_NONE ){
2461 if( isIsoDate(zOrigin) ) zShift = ",'+1 day'";
2462 }
2463 zDate = mprintf("(SELECT julianday(%Q%s, fromLocal()))", zOrigin, zShift);
 
 
 
2464 }else{
2465 fossil_fatal("unknown check-in or invalid date: %s", zOrigin);
2466 }
2467
2468 if( zFilePattern ){
2469
--- src/timeline.c
+++ src/timeline.c
@@ -2447,22 +2447,22 @@
2447 if( !g.localOpen ){
2448 fossil_fatal("must be within a local checkout to use 'current'");
2449 }
2450 objid = db_lget_int("checkout",0);
2451 zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid);
 
 
 
2452 }else if( fossil_is_julianday(zOrigin) ){
2453 const char *zShift = "";
2454 if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
2455 fossil_fatal("cannot compute descendants or ancestors of a date");
2456 }
2457 if( mode==TIMELINE_MODE_NONE ){
2458 if( isIsoDate(zOrigin) ) zShift = ",'+1 day'";
2459 }
2460 zDate = mprintf("(SELECT julianday(%Q%s, fromLocal()))", zOrigin, zShift);
2461 }else if( name_to_uuid(&uuid, 0, "*")==0 ){
2462 objid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid);
2463 zDate = mprintf("(SELECT mtime FROM event WHERE objid=%d)", objid);
2464 }else{
2465 fossil_fatal("unknown check-in or invalid date: %s", zOrigin);
2466 }
2467
2468 if( zFilePattern ){
2469

Keyboard Shortcuts

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