Fossil SCM

One advantage of modifying print_timeline() in stead of using LIMIT: It's possible to put an indication at the end that output stopped because the limit was reached!

jan.nijtmans 2013-10-21 18:44 UTC timeline_cmd_dash_n_fix
Commit d54ada1cead3fb1673a58eb44690344680450360
1 file changed +7 -5
+7 -5
--- src/timeline.c
+++ src/timeline.c
@@ -1540,10 +1540,17 @@
15401540
char *zFree = 0;
15411541
int n = 0;
15421542
char zPrefix[80];
15431543
char zUuid[UUID_SIZE+1];
15441544
1545
+ if( nLimit<0 && nLine>=nAbsLimit ){
1546
+ fossil_print("=== line limit reached ===\n");
1547
+ break; /* line count limit hit, stop. */
1548
+ }else if( nEntry>=nAbsLimit ){
1549
+ fossil_print("=== entry limit reached ===\n");
1550
+ break; /* entry count limit hit, stop. */
1551
+ }
15451552
sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId);
15461553
if( memcmp(zDate, zPrevDate, 10) ){
15471554
fossil_print("=== %.10s ===\n", zDate);
15481555
memcpy(zPrevDate, zDate, 10);
15491556
nLine++; /* record another line */
@@ -1603,15 +1610,10 @@
16031610
}
16041611
db_reset(&fchngQuery);
16051612
}
16061613
nEntry++; /* record another complete entry */
16071614
if( !nAbsLimit ) continue; /* no limit, continue */
1608
- if( nLimit<0 && nLine>=nAbsLimit ){
1609
- break; /* line count limit hit, stop. */
1610
- }else if( nEntry>=nAbsLimit ){
1611
- break; /* entry count limit hit, stop. */
1612
- }
16131615
}
16141616
if( fchngQueryInit ) db_finalize(&fchngQuery);
16151617
}
16161618
16171619
/*
16181620
--- src/timeline.c
+++ src/timeline.c
@@ -1540,10 +1540,17 @@
1540 char *zFree = 0;
1541 int n = 0;
1542 char zPrefix[80];
1543 char zUuid[UUID_SIZE+1];
1544
 
 
 
 
 
 
 
1545 sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId);
1546 if( memcmp(zDate, zPrevDate, 10) ){
1547 fossil_print("=== %.10s ===\n", zDate);
1548 memcpy(zPrevDate, zDate, 10);
1549 nLine++; /* record another line */
@@ -1603,15 +1610,10 @@
1603 }
1604 db_reset(&fchngQuery);
1605 }
1606 nEntry++; /* record another complete entry */
1607 if( !nAbsLimit ) continue; /* no limit, continue */
1608 if( nLimit<0 && nLine>=nAbsLimit ){
1609 break; /* line count limit hit, stop. */
1610 }else if( nEntry>=nAbsLimit ){
1611 break; /* entry count limit hit, stop. */
1612 }
1613 }
1614 if( fchngQueryInit ) db_finalize(&fchngQuery);
1615 }
1616
1617 /*
1618
--- src/timeline.c
+++ src/timeline.c
@@ -1540,10 +1540,17 @@
1540 char *zFree = 0;
1541 int n = 0;
1542 char zPrefix[80];
1543 char zUuid[UUID_SIZE+1];
1544
1545 if( nLimit<0 && nLine>=nAbsLimit ){
1546 fossil_print("=== line limit reached ===\n");
1547 break; /* line count limit hit, stop. */
1548 }else if( nEntry>=nAbsLimit ){
1549 fossil_print("=== entry limit reached ===\n");
1550 break; /* entry count limit hit, stop. */
1551 }
1552 sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId);
1553 if( memcmp(zDate, zPrevDate, 10) ){
1554 fossil_print("=== %.10s ===\n", zDate);
1555 memcpy(zPrevDate, zDate, 10);
1556 nLine++; /* record another line */
@@ -1603,15 +1610,10 @@
1610 }
1611 db_reset(&fchngQuery);
1612 }
1613 nEntry++; /* record another complete entry */
1614 if( !nAbsLimit ) continue; /* no limit, continue */
 
 
 
 
 
1615 }
1616 if( fchngQueryInit ) db_finalize(&fchngQuery);
1617 }
1618
1619 /*
1620

Keyboard Shortcuts

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