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.
Commit
8e01c2257d6e332ed04f005106077a0078d466a5
Parent
611e25d396c2f5b…
2 files changed
+7
-5
+3
-2
+7
-5
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1518,21 +1518,22 @@ | ||
| 1518 | 1518 | void print_timeline(Stmt *q, int nLimit, int width, int verboseFlag){ |
| 1519 | 1519 | int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; |
| 1520 | 1520 | int nLine = 0; |
| 1521 | 1521 | int nEntry = 0; |
| 1522 | 1522 | char zPrevDate[20]; |
| 1523 | - const char *zCurrentUuid=0; | |
| 1523 | + const char *zCurrentUuid = 0; | |
| 1524 | 1524 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 1525 | 1525 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 1526 | - zPrevDate[0] = 0; | |
| 1526 | + int step; | |
| 1527 | 1527 | |
| 1528 | + zPrevDate[0] = 0; | |
| 1528 | 1529 | if( g.localOpen ){ |
| 1529 | 1530 | int rid = db_lget_int("checkout", 0); |
| 1530 | 1531 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1531 | 1532 | } |
| 1532 | 1533 | |
| 1533 | - while( db_step(q)==SQLITE_ROW ){ | |
| 1534 | + while( (step=db_step(q))==SQLITE_ROW ){ | |
| 1534 | 1535 | int rid = db_column_int(q, 0); |
| 1535 | 1536 | const char *zId = db_column_text(q, 1); |
| 1536 | 1537 | const char *zDate = db_column_text(q, 2); |
| 1537 | 1538 | const char *zCom = db_column_text(q, 3); |
| 1538 | 1539 | int nChild = db_column_int(q, 4); |
| @@ -1542,14 +1543,12 @@ | ||
| 1542 | 1543 | char zPrefix[80]; |
| 1543 | 1544 | char zUuid[UUID_SIZE+1]; |
| 1544 | 1545 | |
| 1545 | 1546 | if( nAbsLimit!=0 ){ |
| 1546 | 1547 | if( nLimit<0 && nLine>=nAbsLimit ){ |
| 1547 | - fossil_print("=== line limit (%d) reached ===\n", nAbsLimit); | |
| 1548 | 1548 | break; /* line count limit hit, stop. */ |
| 1549 | 1549 | }else if( nEntry>=nAbsLimit ){ |
| 1550 | - fossil_print("=== entry limit (%d) reached ===\n", nAbsLimit); | |
| 1551 | 1550 | break; /* entry count limit hit, stop. */ |
| 1552 | 1551 | } |
| 1553 | 1552 | } |
| 1554 | 1553 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1555 | 1554 | if( memcmp(zDate, zPrevDate, 10) ){ |
| @@ -1612,10 +1611,13 @@ | ||
| 1612 | 1611 | } |
| 1613 | 1612 | db_reset(&fchngQuery); |
| 1614 | 1613 | } |
| 1615 | 1614 | nEntry++; /* record another complete entry */ |
| 1616 | 1615 | } |
| 1616 | + if( (nAbsLimit!=0) && (step!=SQLITE_ROW) ){ | |
| 1617 | + fossil_print("+++ end of timeline reached +++\n"); | |
| 1618 | + } | |
| 1617 | 1619 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| 1618 | 1620 | } |
| 1619 | 1621 | |
| 1620 | 1622 | /* |
| 1621 | 1623 | ** Return a pointer to a static string that forms the basis for |
| 1622 | 1624 |
| --- 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 |
+3
-2
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -23,12 +23,13 @@ | ||
| 23 | 23 | * Add option -W|--width to the "[/help?cmd=timeline | fossil timeline]" |
| 24 | 24 | and "[/help?cmd=finfo | fossil finfo]" commands. |
| 25 | 25 | * Option -n|--limit of "[/help?cmd=timeline | fossil timeline]" now |
| 26 | 26 | specifies the number of entries, just like all other commands which |
| 27 | 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. | |
| 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. | |
| 30 | 31 | |
| 31 | 32 | <h2>Changes For Version 1.27 (2013-09-11)</h2> |
| 32 | 33 | * Enhance the [/help?cmd=changes | fossil changes], |
| 33 | 34 | [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras], |
| 34 | 35 | [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands |
| 35 | 36 |
| --- 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 |