Fossil SCM

Simplify handling of the limit in print_timeline.

mistachkin 2013-10-21 06:29 UTC trunk
Commit d7f457b4563a812dbc63359a5fb3be370b603234
1 file changed +4 -7
+4 -7
--- src/timeline.c
+++ src/timeline.c
@@ -1494,13 +1494,13 @@
14941494
14951495
/*
14961496
** The input query q selects various records. Print a human-readable
14971497
** summary of those records.
14981498
**
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
15021502
** name details are considered to be part of the entry.
15031503
**
15041504
** The query should return these columns:
15051505
**
15061506
** 0. rid
@@ -1523,14 +1523,11 @@
15231523
if( g.localOpen ){
15241524
int rid = db_lget_int("checkout", 0);
15251525
zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
15261526
}
15271527
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) ){
15321529
int rid = db_column_int(q, 0);
15331530
const char *zId = db_column_text(q, 1);
15341531
const char *zDate = db_column_text(q, 2);
15351532
const char *zCom = db_column_text(q, 3);
15361533
int nChild = db_column_int(q, 4);
15371534
--- 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

Keyboard Shortcuts

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