Fossil SCM
Simplify handling of the limit in print_timeline.
Commit
d7f457b4563a812dbc63359a5fb3be370b603234
Parent
0c312bee2017f2f…
1 file changed
+4
-7
+4
-7
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1494,13 +1494,13 @@ | ||
| 1494 | 1494 | |
| 1495 | 1495 | /* |
| 1496 | 1496 | ** The input query q selects various records. Print a human-readable |
| 1497 | 1497 | ** summary of those records. |
| 1498 | 1498 | ** |
| 1499 | -** Limit the number of lines printed to nLine. If nLimit is negative | |
| 1500 | -** there is no limit. The line limit is approximate because it is | |
| 1501 | -** only checked on a per-entry basis. In verbose mode, the file | |
| 1499 | +** Limit the number of lines printed to mxLine. If mxLine is zero or | |
| 1500 | +** negative there is no limit. The line limit is approximate because | |
| 1501 | +** it is only checked on a per-entry basis. In verbose mode, the file | |
| 1502 | 1502 | ** name details are considered to be part of the entry. |
| 1503 | 1503 | ** |
| 1504 | 1504 | ** The query should return these columns: |
| 1505 | 1505 | ** |
| 1506 | 1506 | ** 0. rid |
| @@ -1523,14 +1523,11 @@ | ||
| 1523 | 1523 | if( g.localOpen ){ |
| 1524 | 1524 | int rid = db_lget_int("checkout", 0); |
| 1525 | 1525 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1526 | 1526 | } |
| 1527 | 1527 | |
| 1528 | - if( mxLine<0 ){ | |
| 1529 | - mxLine = (int)(((unsigned int)-1)>>1); | |
| 1530 | - } | |
| 1531 | - while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){ | |
| 1528 | + while( db_step(q)==SQLITE_ROW && (mxLine<=0 || nLine<=mxLine) ){ | |
| 1532 | 1529 | int rid = db_column_int(q, 0); |
| 1533 | 1530 | const char *zId = db_column_text(q, 1); |
| 1534 | 1531 | const char *zDate = db_column_text(q, 2); |
| 1535 | 1532 | const char *zCom = db_column_text(q, 3); |
| 1536 | 1533 | int nChild = db_column_int(q, 4); |
| 1537 | 1534 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1494,13 +1494,13 @@ | |
| 1494 | |
| 1495 | /* |
| 1496 | ** The input query q selects various records. Print a human-readable |
| 1497 | ** summary of those records. |
| 1498 | ** |
| 1499 | ** Limit the number of lines printed to nLine. If nLimit is negative |
| 1500 | ** there is no limit. The line limit is approximate because it is |
| 1501 | ** only checked on a per-entry basis. In verbose mode, the file |
| 1502 | ** name details are considered to be part of the entry. |
| 1503 | ** |
| 1504 | ** The query should return these columns: |
| 1505 | ** |
| 1506 | ** 0. rid |
| @@ -1523,14 +1523,11 @@ | |
| 1523 | if( g.localOpen ){ |
| 1524 | int rid = db_lget_int("checkout", 0); |
| 1525 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1526 | } |
| 1527 | |
| 1528 | if( mxLine<0 ){ |
| 1529 | mxLine = (int)(((unsigned int)-1)>>1); |
| 1530 | } |
| 1531 | while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){ |
| 1532 | int rid = db_column_int(q, 0); |
| 1533 | const char *zId = db_column_text(q, 1); |
| 1534 | const char *zDate = db_column_text(q, 2); |
| 1535 | const char *zCom = db_column_text(q, 3); |
| 1536 | int nChild = db_column_int(q, 4); |
| 1537 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1494,13 +1494,13 @@ | |
| 1494 | |
| 1495 | /* |
| 1496 | ** The input query q selects various records. Print a human-readable |
| 1497 | ** summary of those records. |
| 1498 | ** |
| 1499 | ** Limit the number of lines printed to mxLine. If mxLine is zero or |
| 1500 | ** negative there is no limit. The line limit is approximate because |
| 1501 | ** it is only checked on a per-entry basis. In verbose mode, the file |
| 1502 | ** name details are considered to be part of the entry. |
| 1503 | ** |
| 1504 | ** The query should return these columns: |
| 1505 | ** |
| 1506 | ** 0. rid |
| @@ -1523,14 +1523,11 @@ | |
| 1523 | if( g.localOpen ){ |
| 1524 | int rid = db_lget_int("checkout", 0); |
| 1525 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1526 | } |
| 1527 | |
| 1528 | while( db_step(q)==SQLITE_ROW && (mxLine<=0 || nLine<=mxLine) ){ |
| 1529 | int rid = db_column_int(q, 0); |
| 1530 | const char *zId = db_column_text(q, 1); |
| 1531 | const char *zDate = db_column_text(q, 2); |
| 1532 | const char *zCom = db_column_text(q, 3); |
| 1533 | int nChild = db_column_int(q, 4); |
| 1534 |