Fossil SCM
Correctly determine whether the limit was really reached, this time without my mistake in [d54ada1cea] which didn't handle "-n 0" correctly.
Commit
feb175065c028d12e1ec3928ee4b224dd956cdd1
Parent
521f7a14e024997…
1 file changed
+9
-8
+9
-8
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1540,10 +1540,19 @@ | ||
| 1540 | 1540 | char *zFree = 0; |
| 1541 | 1541 | int n = 0; |
| 1542 | 1542 | char zPrefix[80]; |
| 1543 | 1543 | char zUuid[UUID_SIZE+1]; |
| 1544 | 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 | + } | |
| 1545 | 1554 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1546 | 1555 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1547 | 1556 | fossil_print("=== %.10s ===\n", zDate); |
| 1548 | 1557 | memcpy(zPrevDate, zDate, 10); |
| 1549 | 1558 | nLine++; /* record another line */ |
| @@ -1602,18 +1611,10 @@ | ||
| 1602 | 1611 | nLine++; /* record another line */ |
| 1603 | 1612 | } |
| 1604 | 1613 | db_reset(&fchngQuery); |
| 1605 | 1614 | } |
| 1606 | 1615 | nEntry++; /* record another complete entry */ |
| 1607 | - if( !nAbsLimit ) continue; /* no limit, continue */ | |
| 1608 | - if( nLimit<0 && nLine>=nAbsLimit ){ | |
| 1609 | - fossil_print("=== line limit reached ===\n"); | |
| 1610 | - break; /* line count limit hit, stop. */ | |
| 1611 | - }else if( nEntry>=nAbsLimit ){ | |
| 1612 | - fossil_print("=== entry limit reached ===\n"); | |
| 1613 | - break; /* entry count limit hit, stop. */ | |
| 1614 | - } | |
| 1615 | 1616 | } |
| 1616 | 1617 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| 1617 | 1618 | } |
| 1618 | 1619 | |
| 1619 | 1620 | /* |
| 1620 | 1621 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1540,10 +1540,19 @@ | |
| 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 */ |
| @@ -1602,18 +1611,10 @@ | |
| 1602 | nLine++; /* record another line */ |
| 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 | fossil_print("=== line limit reached ===\n"); |
| 1610 | break; /* line count limit hit, stop. */ |
| 1611 | }else if( nEntry>=nAbsLimit ){ |
| 1612 | fossil_print("=== entry limit reached ===\n"); |
| 1613 | break; /* entry count limit hit, stop. */ |
| 1614 | } |
| 1615 | } |
| 1616 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| 1617 | } |
| 1618 | |
| 1619 | /* |
| 1620 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1540,10 +1540,19 @@ | |
| 1540 | char *zFree = 0; |
| 1541 | int n = 0; |
| 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) ){ |
| 1556 | fossil_print("=== %.10s ===\n", zDate); |
| 1557 | memcpy(zPrevDate, zDate, 10); |
| 1558 | nLine++; /* record another line */ |
| @@ -1602,18 +1611,10 @@ | |
| 1611 | nLine++; /* record another line */ |
| 1612 | } |
| 1613 | db_reset(&fchngQuery); |
| 1614 | } |
| 1615 | nEntry++; /* record another complete entry */ |
| 1616 | } |
| 1617 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| 1618 | } |
| 1619 | |
| 1620 | /* |
| 1621 |