Fossil SCM

Output "+++ end of timeline reached +++" when appropriate at the end of timeline output in stead of marker indicating that a limit is reached. After ML request. If n=0 no marker will be output.

jan.nijtmans 2013-11-11 19:32 trunk
Commit 8e01c2257d6e332ed04f005106077a0078d466a5
2 files changed +7 -5 +3 -2
+7 -5
--- src/timeline.c
+++ src/timeline.c
@@ -1518,21 +1518,22 @@
15181518
void print_timeline(Stmt *q, int nLimit, int width, int verboseFlag){
15191519
int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit;
15201520
int nLine = 0;
15211521
int nEntry = 0;
15221522
char zPrevDate[20];
1523
- const char *zCurrentUuid=0;
1523
+ const char *zCurrentUuid = 0;
15241524
int fchngQueryInit = 0; /* True if fchngQuery is initialized */
15251525
Stmt fchngQuery; /* Query for file changes on check-ins */
1526
- zPrevDate[0] = 0;
1526
+ int step;
15271527
1528
+ zPrevDate[0] = 0;
15281529
if( g.localOpen ){
15291530
int rid = db_lget_int("checkout", 0);
15301531
zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
15311532
}
15321533
1533
- while( db_step(q)==SQLITE_ROW ){
1534
+ while( (step=db_step(q))==SQLITE_ROW ){
15341535
int rid = db_column_int(q, 0);
15351536
const char *zId = db_column_text(q, 1);
15361537
const char *zDate = db_column_text(q, 2);
15371538
const char *zCom = db_column_text(q, 3);
15381539
int nChild = db_column_int(q, 4);
@@ -1542,14 +1543,12 @@
15421543
char zPrefix[80];
15431544
char zUuid[UUID_SIZE+1];
15441545
15451546
if( nAbsLimit!=0 ){
15461547
if( nLimit<0 && nLine>=nAbsLimit ){
1547
- fossil_print("=== line limit (%d) reached ===\n", nAbsLimit);
15481548
break; /* line count limit hit, stop. */
15491549
}else if( nEntry>=nAbsLimit ){
1550
- fossil_print("=== entry limit (%d) reached ===\n", nAbsLimit);
15511550
break; /* entry count limit hit, stop. */
15521551
}
15531552
}
15541553
sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId);
15551554
if( memcmp(zDate, zPrevDate, 10) ){
@@ -1612,10 +1611,13 @@
16121611
}
16131612
db_reset(&fchngQuery);
16141613
}
16151614
nEntry++; /* record another complete entry */
16161615
}
1616
+ if( (nAbsLimit!=0) && (step!=SQLITE_ROW) ){
1617
+ fossil_print("+++ end of timeline reached +++\n");
1618
+ }
16171619
if( fchngQueryInit ) db_finalize(&fchngQuery);
16181620
}
16191621
16201622
/*
16211623
** Return a pointer to a static string that forms the basis for
16221624
--- src/timeline.c
+++ src/timeline.c
@@ -1518,21 +1518,22 @@
1518 void print_timeline(Stmt *q, int nLimit, int width, int verboseFlag){
1519 int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit;
1520 int nLine = 0;
1521 int nEntry = 0;
1522 char zPrevDate[20];
1523 const char *zCurrentUuid=0;
1524 int fchngQueryInit = 0; /* True if fchngQuery is initialized */
1525 Stmt fchngQuery; /* Query for file changes on check-ins */
1526 zPrevDate[0] = 0;
1527
 
1528 if( g.localOpen ){
1529 int rid = db_lget_int("checkout", 0);
1530 zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
1531 }
1532
1533 while( db_step(q)==SQLITE_ROW ){
1534 int rid = db_column_int(q, 0);
1535 const char *zId = db_column_text(q, 1);
1536 const char *zDate = db_column_text(q, 2);
1537 const char *zCom = db_column_text(q, 3);
1538 int nChild = db_column_int(q, 4);
@@ -1542,14 +1543,12 @@
1542 char zPrefix[80];
1543 char zUuid[UUID_SIZE+1];
1544
1545 if( nAbsLimit!=0 ){
1546 if( nLimit<0 && nLine>=nAbsLimit ){
1547 fossil_print("=== line limit (%d) reached ===\n", nAbsLimit);
1548 break; /* line count limit hit, stop. */
1549 }else if( nEntry>=nAbsLimit ){
1550 fossil_print("=== entry limit (%d) reached ===\n", nAbsLimit);
1551 break; /* entry count limit hit, stop. */
1552 }
1553 }
1554 sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId);
1555 if( memcmp(zDate, zPrevDate, 10) ){
@@ -1612,10 +1611,13 @@
1612 }
1613 db_reset(&fchngQuery);
1614 }
1615 nEntry++; /* record another complete entry */
1616 }
 
 
 
1617 if( fchngQueryInit ) db_finalize(&fchngQuery);
1618 }
1619
1620 /*
1621 ** Return a pointer to a static string that forms the basis for
1622
--- src/timeline.c
+++ src/timeline.c
@@ -1518,21 +1518,22 @@
1518 void print_timeline(Stmt *q, int nLimit, int width, int verboseFlag){
1519 int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit;
1520 int nLine = 0;
1521 int nEntry = 0;
1522 char zPrevDate[20];
1523 const char *zCurrentUuid = 0;
1524 int fchngQueryInit = 0; /* True if fchngQuery is initialized */
1525 Stmt fchngQuery; /* Query for file changes on check-ins */
1526 int step;
1527
1528 zPrevDate[0] = 0;
1529 if( g.localOpen ){
1530 int rid = db_lget_int("checkout", 0);
1531 zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
1532 }
1533
1534 while( (step=db_step(q))==SQLITE_ROW ){
1535 int rid = db_column_int(q, 0);
1536 const char *zId = db_column_text(q, 1);
1537 const char *zDate = db_column_text(q, 2);
1538 const char *zCom = db_column_text(q, 3);
1539 int nChild = db_column_int(q, 4);
@@ -1542,14 +1543,12 @@
1543 char zPrefix[80];
1544 char zUuid[UUID_SIZE+1];
1545
1546 if( nAbsLimit!=0 ){
1547 if( nLimit<0 && nLine>=nAbsLimit ){
 
1548 break; /* line count limit hit, stop. */
1549 }else if( nEntry>=nAbsLimit ){
 
1550 break; /* entry count limit hit, stop. */
1551 }
1552 }
1553 sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId);
1554 if( memcmp(zDate, zPrevDate, 10) ){
@@ -1612,10 +1611,13 @@
1611 }
1612 db_reset(&fchngQuery);
1613 }
1614 nEntry++; /* record another complete entry */
1615 }
1616 if( (nAbsLimit!=0) && (step!=SQLITE_ROW) ){
1617 fossil_print("+++ end of timeline reached +++\n");
1618 }
1619 if( fchngQueryInit ) db_finalize(&fchngQuery);
1620 }
1621
1622 /*
1623 ** Return a pointer to a static string that forms the basis for
1624
--- www/changes.wiki
+++ www/changes.wiki
@@ -23,12 +23,13 @@
2323
* Add option -W|--width to the "[/help?cmd=timeline | fossil timeline]"
2424
and "[/help?cmd=finfo | fossil finfo]" commands.
2525
* Option -n|--limit of "[/help?cmd=timeline | fossil timeline]" now
2626
specifies the number of entries, just like all other commands which
2727
have the -n|--limit option. The various timeline-related functions
28
- now output "=== ?? limit (??) reached ===" at the end whenever
29
- appropriate. Use "-n 0" if no limit is desired.
28
+ now output "+++ end of timeline reached +++" whenever appropriate.
29
+ Use "-n 0" if no limit is desired, the end of timeline marker will
30
+ not be printed then.
3031
3132
<h2>Changes For Version 1.27 (2013-09-11)</h2>
3233
* Enhance the [/help?cmd=changes | fossil changes],
3334
[/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
3435
[/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
3536
--- www/changes.wiki
+++ www/changes.wiki
@@ -23,12 +23,13 @@
23 * Add option -W|--width to the "[/help?cmd=timeline | fossil timeline]"
24 and "[/help?cmd=finfo | fossil finfo]" commands.
25 * Option -n|--limit of "[/help?cmd=timeline | fossil timeline]" now
26 specifies the number of entries, just like all other commands which
27 have the -n|--limit option. The various timeline-related functions
28 now output "=== ?? limit (??) reached ===" at the end whenever
29 appropriate. Use "-n 0" if no limit is desired.
 
30
31 <h2>Changes For Version 1.27 (2013-09-11)</h2>
32 * Enhance the [/help?cmd=changes | fossil changes],
33 [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
34 [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
35
--- www/changes.wiki
+++ www/changes.wiki
@@ -23,12 +23,13 @@
23 * Add option -W|--width to the "[/help?cmd=timeline | fossil timeline]"
24 and "[/help?cmd=finfo | fossil finfo]" commands.
25 * Option -n|--limit of "[/help?cmd=timeline | fossil timeline]" now
26 specifies the number of entries, just like all other commands which
27 have the -n|--limit option. The various timeline-related functions
28 now output "+++ end of timeline reached +++" whenever appropriate.
29 Use "-n 0" if no limit is desired, the end of timeline marker will
30 not be printed then.
31
32 <h2>Changes For Version 1.27 (2013-09-11)</h2>
33 * Enhance the [/help?cmd=changes | fossil changes],
34 [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
35 [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
36

Keyboard Shortcuts

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