Fossil

Check-in [d54ada1c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:One advantage of modifying print_timeline() in stead of using LIMIT: It's possible to put an indication at the end that output stopped because the limit was reached!
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | timeline_cmd_dash_n_fix
Files: files | file ages | folders
SHA1:d54ada1cead3fb1673a58eb44690344680450360
User & Date: jan.nijtmans 2013-10-21 18:44:54
References
2013-10-22
07:41
Correctly determine whether the limit was really reached, this time without my mistake in [d54ada1cea] which didn't handle "-n 0" correctly. check-in: feb17506 user: jan.nijtmans tags: timeline_cmd_dash_n_fix
Context
2013-10-22
03:40
Perform timeline limit checks at the end of the loop, after checking if a limit exists. check-in: 521f7a14 user: mistachkin tags: timeline_cmd_dash_n_fix
2013-10-21
18:44
One advantage of modifying print_timeline() in stead of using LIMIT: It's possible to put an indication at the end that output stopped because the limit was reached! check-in: d54ada1c user: jan.nijtmans tags: timeline_cmd_dash_n_fix
18:38
merge trunk check-in: 0e4dee00 user: jan.nijtmans tags: timeline_cmd_dash_n_fix
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/timeline.c.

1538
1539
1540
1541
1542
1543
1544







1545
1546
1547
1548
1549
1550
1551
....
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
    int nChild = db_column_int(q, 4);
    int nParent = db_column_int(q, 5);
    char *zFree = 0;
    int n = 0;
    char zPrefix[80];
    char zUuid[UUID_SIZE+1];








    sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId);
    if( memcmp(zDate, zPrevDate, 10) ){
      fossil_print("=== %.10s ===\n", zDate);
      memcpy(zPrevDate, zDate, 10);
      nLine++; /* record another line */
    }
    if( zCom==0 ) zCom = "";
................................................................................
        }
        nLine++; /* record another line */
      }
      db_reset(&fchngQuery);
    }
    nEntry++; /* record another complete entry */
    if( !nAbsLimit ) continue; /* no limit, continue */
    if( nLimit<0 && nLine>=nAbsLimit ){
      break; /* line count limit hit, stop. */
    }else if( nEntry>=nAbsLimit ){
      break; /* entry count limit hit, stop. */
    }
  }
  if( fchngQueryInit ) db_finalize(&fchngQuery);
}

/*
** Return a pointer to a static string that forms the basis for
** a timeline query for display on a TTY.







>
>
>
>
>
>
>







 







<
<
<
<
<







1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
....
1608
1609
1610
1611
1612
1613
1614





1615
1616
1617
1618
1619
1620
1621
    int nChild = db_column_int(q, 4);
    int nParent = db_column_int(q, 5);
    char *zFree = 0;
    int n = 0;
    char zPrefix[80];
    char zUuid[UUID_SIZE+1];

    if( nLimit<0 && nLine>=nAbsLimit ){
      fossil_print("=== line limit reached ===\n");
      break; /* line count limit hit, stop. */
    }else if( nEntry>=nAbsLimit ){
      fossil_print("=== entry limit reached ===\n");
      break; /* entry count limit hit, stop. */
    }
    sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId);
    if( memcmp(zDate, zPrevDate, 10) ){
      fossil_print("=== %.10s ===\n", zDate);
      memcpy(zPrevDate, zDate, 10);
      nLine++; /* record another line */
    }
    if( zCom==0 ) zCom = "";
................................................................................
        }
        nLine++; /* record another line */
      }
      db_reset(&fchngQuery);
    }
    nEntry++; /* record another complete entry */
    if( !nAbsLimit ) continue; /* no limit, continue */





  }
  if( fchngQueryInit ) db_finalize(&fchngQuery);
}

/*
** Return a pointer to a static string that forms the basis for
** a timeline query for display on a TTY.