Fossil SCM
Fix default "fossil timeline -n" value. Merge trunk, and simplify code makeing use of the trunk improvements.
Commit
4fdffd7d3ef577458954094c162a8cb20371f6d3
Parent
c6a49e29b9fa969…
2 files changed
+10
-9
+10
-9
+10
-9
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1494,11 +1494,14 @@ | ||
| 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 entries printed to nLine. | |
| 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. | |
| 1500 | 1503 | ** |
| 1501 | 1504 | ** The query should return these columns: |
| 1502 | 1505 | ** |
| 1503 | 1506 | ** 0. rid |
| 1504 | 1507 | ** 1. uuid |
| @@ -1520,11 +1523,11 @@ | ||
| 1520 | 1523 | if( g.localOpen ){ |
| 1521 | 1524 | int rid = db_lget_int("checkout", 0); |
| 1522 | 1525 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1523 | 1526 | } |
| 1524 | 1527 | |
| 1525 | - while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){ | |
| 1528 | + while( db_step(q)==SQLITE_ROW && (mxLine<=0 || nLine<=mxLine) ){ | |
| 1526 | 1529 | int rid = db_column_int(q, 0); |
| 1527 | 1530 | const char *zId = db_column_text(q, 1); |
| 1528 | 1531 | const char *zDate = db_column_text(q, 2); |
| 1529 | 1532 | const char *zCom = db_column_text(q, 3); |
| 1530 | 1533 | int nChild = db_column_int(q, 4); |
| @@ -1536,11 +1539,11 @@ | ||
| 1536 | 1539 | |
| 1537 | 1540 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1538 | 1541 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1539 | 1542 | fossil_print("=== %.10s ===\n", zDate); |
| 1540 | 1543 | memcpy(zPrevDate, zDate, 10); |
| 1541 | - nLine++; | |
| 1544 | + nLine++; /* record another line */ | |
| 1542 | 1545 | } |
| 1543 | 1546 | if( zCom==0 ) zCom = ""; |
| 1544 | 1547 | fossil_print("%.8s ", &zDate[11]); |
| 1545 | 1548 | zPrefix[0] = 0; |
| 1546 | 1549 | if( nParent>1 ){ |
| @@ -1560,11 +1563,11 @@ | ||
| 1560 | 1563 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1561 | 1564 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1562 | 1565 | n += strlen(zPrefix); |
| 1563 | 1566 | } |
| 1564 | 1567 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1565 | - nLine += comment_print(zFree, 9, 79); | |
| 1568 | + nLine += comment_print(zFree, 9, 79); /* record another X lines */ | |
| 1566 | 1569 | sqlite3_free(zFree); |
| 1567 | 1570 | |
| 1568 | 1571 | if(verboseFlag){ |
| 1569 | 1572 | if( !fchngQueryInit ){ |
| 1570 | 1573 | db_prepare(&fchngQuery, |
| @@ -1589,10 +1592,11 @@ | ||
| 1589 | 1592 | }else if( isDel ){ |
| 1590 | 1593 | fossil_print(" DELETED %s\n",zFilename); |
| 1591 | 1594 | }else{ |
| 1592 | 1595 | fossil_print(" EDITED %s\n", zFilename); |
| 1593 | 1596 | } |
| 1597 | + nLine++; /* record another line */ | |
| 1594 | 1598 | } |
| 1595 | 1599 | db_reset(&fchngQuery); |
| 1596 | 1600 | } |
| 1597 | 1601 | } |
| 1598 | 1602 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| @@ -1697,11 +1701,11 @@ | ||
| 1697 | 1701 | zLimit = find_option("count",0,1); |
| 1698 | 1702 | } |
| 1699 | 1703 | if( zLimit ){ |
| 1700 | 1704 | n = atoi(zLimit); |
| 1701 | 1705 | }else{ |
| 1702 | - n = 20; | |
| 1706 | + n = -20; | |
| 1703 | 1707 | } |
| 1704 | 1708 | if( g.argc>=4 ){ |
| 1705 | 1709 | k = strlen(g.argv[2]); |
| 1706 | 1710 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1707 | 1711 | mode = 1; |
| @@ -1776,17 +1780,14 @@ | ||
| 1776 | 1780 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1777 | 1781 | } |
| 1778 | 1782 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1779 | 1783 | if(n>0){ |
| 1780 | 1784 | blob_appendf(&sql, " LIMIT %d", n); |
| 1781 | - n = 9999999; | |
| 1782 | - }else{ | |
| 1783 | - n = -n; | |
| 1784 | 1785 | } |
| 1785 | 1786 | db_prepare(&q, blob_str(&sql)); |
| 1786 | 1787 | blob_reset(&sql); |
| 1787 | - print_timeline(&q, n, verboseFlag); | |
| 1788 | + print_timeline(&q, n<0?-n:0, verboseFlag); | |
| 1788 | 1789 | db_finalize(&q); |
| 1789 | 1790 | } |
| 1790 | 1791 | |
| 1791 | 1792 | /* |
| 1792 | 1793 | ** This is a version of the "localtime()" function from the standard |
| 1793 | 1794 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1494,11 +1494,14 @@ | |
| 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 entries printed to nLine. |
| 1500 | ** |
| 1501 | ** The query should return these columns: |
| 1502 | ** |
| 1503 | ** 0. rid |
| 1504 | ** 1. uuid |
| @@ -1520,11 +1523,11 @@ | |
| 1520 | if( g.localOpen ){ |
| 1521 | int rid = db_lget_int("checkout", 0); |
| 1522 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1523 | } |
| 1524 | |
| 1525 | while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){ |
| 1526 | int rid = db_column_int(q, 0); |
| 1527 | const char *zId = db_column_text(q, 1); |
| 1528 | const char *zDate = db_column_text(q, 2); |
| 1529 | const char *zCom = db_column_text(q, 3); |
| 1530 | int nChild = db_column_int(q, 4); |
| @@ -1536,11 +1539,11 @@ | |
| 1536 | |
| 1537 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1538 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1539 | fossil_print("=== %.10s ===\n", zDate); |
| 1540 | memcpy(zPrevDate, zDate, 10); |
| 1541 | nLine++; |
| 1542 | } |
| 1543 | if( zCom==0 ) zCom = ""; |
| 1544 | fossil_print("%.8s ", &zDate[11]); |
| 1545 | zPrefix[0] = 0; |
| 1546 | if( nParent>1 ){ |
| @@ -1560,11 +1563,11 @@ | |
| 1560 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1561 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1562 | n += strlen(zPrefix); |
| 1563 | } |
| 1564 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1565 | nLine += comment_print(zFree, 9, 79); |
| 1566 | sqlite3_free(zFree); |
| 1567 | |
| 1568 | if(verboseFlag){ |
| 1569 | if( !fchngQueryInit ){ |
| 1570 | db_prepare(&fchngQuery, |
| @@ -1589,10 +1592,11 @@ | |
| 1589 | }else if( isDel ){ |
| 1590 | fossil_print(" DELETED %s\n",zFilename); |
| 1591 | }else{ |
| 1592 | fossil_print(" EDITED %s\n", zFilename); |
| 1593 | } |
| 1594 | } |
| 1595 | db_reset(&fchngQuery); |
| 1596 | } |
| 1597 | } |
| 1598 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| @@ -1697,11 +1701,11 @@ | |
| 1697 | zLimit = find_option("count",0,1); |
| 1698 | } |
| 1699 | if( zLimit ){ |
| 1700 | n = atoi(zLimit); |
| 1701 | }else{ |
| 1702 | n = 20; |
| 1703 | } |
| 1704 | if( g.argc>=4 ){ |
| 1705 | k = strlen(g.argv[2]); |
| 1706 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1707 | mode = 1; |
| @@ -1776,17 +1780,14 @@ | |
| 1776 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1777 | } |
| 1778 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1779 | if(n>0){ |
| 1780 | blob_appendf(&sql, " LIMIT %d", n); |
| 1781 | n = 9999999; |
| 1782 | }else{ |
| 1783 | n = -n; |
| 1784 | } |
| 1785 | db_prepare(&q, blob_str(&sql)); |
| 1786 | blob_reset(&sql); |
| 1787 | print_timeline(&q, n, verboseFlag); |
| 1788 | db_finalize(&q); |
| 1789 | } |
| 1790 | |
| 1791 | /* |
| 1792 | ** This is a version of the "localtime()" function from the standard |
| 1793 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1494,11 +1494,14 @@ | |
| 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 |
| 1507 | ** 1. uuid |
| @@ -1520,11 +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); |
| @@ -1536,11 +1539,11 @@ | |
| 1539 | |
| 1540 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1541 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1542 | fossil_print("=== %.10s ===\n", zDate); |
| 1543 | memcpy(zPrevDate, zDate, 10); |
| 1544 | nLine++; /* record another line */ |
| 1545 | } |
| 1546 | if( zCom==0 ) zCom = ""; |
| 1547 | fossil_print("%.8s ", &zDate[11]); |
| 1548 | zPrefix[0] = 0; |
| 1549 | if( nParent>1 ){ |
| @@ -1560,11 +1563,11 @@ | |
| 1563 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1564 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1565 | n += strlen(zPrefix); |
| 1566 | } |
| 1567 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1568 | nLine += comment_print(zFree, 9, 79); /* record another X lines */ |
| 1569 | sqlite3_free(zFree); |
| 1570 | |
| 1571 | if(verboseFlag){ |
| 1572 | if( !fchngQueryInit ){ |
| 1573 | db_prepare(&fchngQuery, |
| @@ -1589,10 +1592,11 @@ | |
| 1592 | }else if( isDel ){ |
| 1593 | fossil_print(" DELETED %s\n",zFilename); |
| 1594 | }else{ |
| 1595 | fossil_print(" EDITED %s\n", zFilename); |
| 1596 | } |
| 1597 | nLine++; /* record another line */ |
| 1598 | } |
| 1599 | db_reset(&fchngQuery); |
| 1600 | } |
| 1601 | } |
| 1602 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| @@ -1697,11 +1701,11 @@ | |
| 1701 | zLimit = find_option("count",0,1); |
| 1702 | } |
| 1703 | if( zLimit ){ |
| 1704 | n = atoi(zLimit); |
| 1705 | }else{ |
| 1706 | n = -20; |
| 1707 | } |
| 1708 | if( g.argc>=4 ){ |
| 1709 | k = strlen(g.argv[2]); |
| 1710 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1711 | mode = 1; |
| @@ -1776,17 +1780,14 @@ | |
| 1780 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1781 | } |
| 1782 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1783 | if(n>0){ |
| 1784 | blob_appendf(&sql, " LIMIT %d", n); |
| 1785 | } |
| 1786 | db_prepare(&q, blob_str(&sql)); |
| 1787 | blob_reset(&sql); |
| 1788 | print_timeline(&q, n<0?-n:0, verboseFlag); |
| 1789 | db_finalize(&q); |
| 1790 | } |
| 1791 | |
| 1792 | /* |
| 1793 | ** This is a version of the "localtime()" function from the standard |
| 1794 |
+10
-9
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1494,11 +1494,14 @@ | ||
| 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 entries printed to nLine. | |
| 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. | |
| 1500 | 1503 | ** |
| 1501 | 1504 | ** The query should return these columns: |
| 1502 | 1505 | ** |
| 1503 | 1506 | ** 0. rid |
| 1504 | 1507 | ** 1. uuid |
| @@ -1520,11 +1523,11 @@ | ||
| 1520 | 1523 | if( g.localOpen ){ |
| 1521 | 1524 | int rid = db_lget_int("checkout", 0); |
| 1522 | 1525 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1523 | 1526 | } |
| 1524 | 1527 | |
| 1525 | - while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){ | |
| 1528 | + while( db_step(q)==SQLITE_ROW && (mxLine<=0 || nLine<=mxLine) ){ | |
| 1526 | 1529 | int rid = db_column_int(q, 0); |
| 1527 | 1530 | const char *zId = db_column_text(q, 1); |
| 1528 | 1531 | const char *zDate = db_column_text(q, 2); |
| 1529 | 1532 | const char *zCom = db_column_text(q, 3); |
| 1530 | 1533 | int nChild = db_column_int(q, 4); |
| @@ -1536,11 +1539,11 @@ | ||
| 1536 | 1539 | |
| 1537 | 1540 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1538 | 1541 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1539 | 1542 | fossil_print("=== %.10s ===\n", zDate); |
| 1540 | 1543 | memcpy(zPrevDate, zDate, 10); |
| 1541 | - nLine++; | |
| 1544 | + nLine++; /* record another line */ | |
| 1542 | 1545 | } |
| 1543 | 1546 | if( zCom==0 ) zCom = ""; |
| 1544 | 1547 | fossil_print("%.8s ", &zDate[11]); |
| 1545 | 1548 | zPrefix[0] = 0; |
| 1546 | 1549 | if( nParent>1 ){ |
| @@ -1560,11 +1563,11 @@ | ||
| 1560 | 1563 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1561 | 1564 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1562 | 1565 | n += strlen(zPrefix); |
| 1563 | 1566 | } |
| 1564 | 1567 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1565 | - nLine += comment_print(zFree, 9, 79); | |
| 1568 | + nLine += comment_print(zFree, 9, 79); /* record another X lines */ | |
| 1566 | 1569 | sqlite3_free(zFree); |
| 1567 | 1570 | |
| 1568 | 1571 | if(verboseFlag){ |
| 1569 | 1572 | if( !fchngQueryInit ){ |
| 1570 | 1573 | db_prepare(&fchngQuery, |
| @@ -1589,10 +1592,11 @@ | ||
| 1589 | 1592 | }else if( isDel ){ |
| 1590 | 1593 | fossil_print(" DELETED %s\n",zFilename); |
| 1591 | 1594 | }else{ |
| 1592 | 1595 | fossil_print(" EDITED %s\n", zFilename); |
| 1593 | 1596 | } |
| 1597 | + nLine++; /* record another line */ | |
| 1594 | 1598 | } |
| 1595 | 1599 | db_reset(&fchngQuery); |
| 1596 | 1600 | } |
| 1597 | 1601 | } |
| 1598 | 1602 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| @@ -1697,11 +1701,11 @@ | ||
| 1697 | 1701 | zLimit = find_option("count",0,1); |
| 1698 | 1702 | } |
| 1699 | 1703 | if( zLimit ){ |
| 1700 | 1704 | n = atoi(zLimit); |
| 1701 | 1705 | }else{ |
| 1702 | - n = 20; | |
| 1706 | + n = -20; | |
| 1703 | 1707 | } |
| 1704 | 1708 | if( g.argc>=4 ){ |
| 1705 | 1709 | k = strlen(g.argv[2]); |
| 1706 | 1710 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1707 | 1711 | mode = 1; |
| @@ -1776,17 +1780,14 @@ | ||
| 1776 | 1780 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1777 | 1781 | } |
| 1778 | 1782 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1779 | 1783 | if(n>0){ |
| 1780 | 1784 | blob_appendf(&sql, " LIMIT %d", n); |
| 1781 | - n = 9999999; | |
| 1782 | - }else{ | |
| 1783 | - n = -n; | |
| 1784 | 1785 | } |
| 1785 | 1786 | db_prepare(&q, blob_str(&sql)); |
| 1786 | 1787 | blob_reset(&sql); |
| 1787 | - print_timeline(&q, n, verboseFlag); | |
| 1788 | + print_timeline(&q, n<0?-n:0, verboseFlag); | |
| 1788 | 1789 | db_finalize(&q); |
| 1789 | 1790 | } |
| 1790 | 1791 | |
| 1791 | 1792 | /* |
| 1792 | 1793 | ** This is a version of the "localtime()" function from the standard |
| 1793 | 1794 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1494,11 +1494,14 @@ | |
| 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 entries printed to nLine. |
| 1500 | ** |
| 1501 | ** The query should return these columns: |
| 1502 | ** |
| 1503 | ** 0. rid |
| 1504 | ** 1. uuid |
| @@ -1520,11 +1523,11 @@ | |
| 1520 | if( g.localOpen ){ |
| 1521 | int rid = db_lget_int("checkout", 0); |
| 1522 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1523 | } |
| 1524 | |
| 1525 | while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){ |
| 1526 | int rid = db_column_int(q, 0); |
| 1527 | const char *zId = db_column_text(q, 1); |
| 1528 | const char *zDate = db_column_text(q, 2); |
| 1529 | const char *zCom = db_column_text(q, 3); |
| 1530 | int nChild = db_column_int(q, 4); |
| @@ -1536,11 +1539,11 @@ | |
| 1536 | |
| 1537 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1538 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1539 | fossil_print("=== %.10s ===\n", zDate); |
| 1540 | memcpy(zPrevDate, zDate, 10); |
| 1541 | nLine++; |
| 1542 | } |
| 1543 | if( zCom==0 ) zCom = ""; |
| 1544 | fossil_print("%.8s ", &zDate[11]); |
| 1545 | zPrefix[0] = 0; |
| 1546 | if( nParent>1 ){ |
| @@ -1560,11 +1563,11 @@ | |
| 1560 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1561 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1562 | n += strlen(zPrefix); |
| 1563 | } |
| 1564 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1565 | nLine += comment_print(zFree, 9, 79); |
| 1566 | sqlite3_free(zFree); |
| 1567 | |
| 1568 | if(verboseFlag){ |
| 1569 | if( !fchngQueryInit ){ |
| 1570 | db_prepare(&fchngQuery, |
| @@ -1589,10 +1592,11 @@ | |
| 1589 | }else if( isDel ){ |
| 1590 | fossil_print(" DELETED %s\n",zFilename); |
| 1591 | }else{ |
| 1592 | fossil_print(" EDITED %s\n", zFilename); |
| 1593 | } |
| 1594 | } |
| 1595 | db_reset(&fchngQuery); |
| 1596 | } |
| 1597 | } |
| 1598 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| @@ -1697,11 +1701,11 @@ | |
| 1697 | zLimit = find_option("count",0,1); |
| 1698 | } |
| 1699 | if( zLimit ){ |
| 1700 | n = atoi(zLimit); |
| 1701 | }else{ |
| 1702 | n = 20; |
| 1703 | } |
| 1704 | if( g.argc>=4 ){ |
| 1705 | k = strlen(g.argv[2]); |
| 1706 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1707 | mode = 1; |
| @@ -1776,17 +1780,14 @@ | |
| 1776 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1777 | } |
| 1778 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1779 | if(n>0){ |
| 1780 | blob_appendf(&sql, " LIMIT %d", n); |
| 1781 | n = 9999999; |
| 1782 | }else{ |
| 1783 | n = -n; |
| 1784 | } |
| 1785 | db_prepare(&q, blob_str(&sql)); |
| 1786 | blob_reset(&sql); |
| 1787 | print_timeline(&q, n, verboseFlag); |
| 1788 | db_finalize(&q); |
| 1789 | } |
| 1790 | |
| 1791 | /* |
| 1792 | ** This is a version of the "localtime()" function from the standard |
| 1793 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1494,11 +1494,14 @@ | |
| 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 |
| 1507 | ** 1. uuid |
| @@ -1520,11 +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); |
| @@ -1536,11 +1539,11 @@ | |
| 1539 | |
| 1540 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1541 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1542 | fossil_print("=== %.10s ===\n", zDate); |
| 1543 | memcpy(zPrevDate, zDate, 10); |
| 1544 | nLine++; /* record another line */ |
| 1545 | } |
| 1546 | if( zCom==0 ) zCom = ""; |
| 1547 | fossil_print("%.8s ", &zDate[11]); |
| 1548 | zPrefix[0] = 0; |
| 1549 | if( nParent>1 ){ |
| @@ -1560,11 +1563,11 @@ | |
| 1563 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1564 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1565 | n += strlen(zPrefix); |
| 1566 | } |
| 1567 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1568 | nLine += comment_print(zFree, 9, 79); /* record another X lines */ |
| 1569 | sqlite3_free(zFree); |
| 1570 | |
| 1571 | if(verboseFlag){ |
| 1572 | if( !fchngQueryInit ){ |
| 1573 | db_prepare(&fchngQuery, |
| @@ -1589,10 +1592,11 @@ | |
| 1592 | }else if( isDel ){ |
| 1593 | fossil_print(" DELETED %s\n",zFilename); |
| 1594 | }else{ |
| 1595 | fossil_print(" EDITED %s\n", zFilename); |
| 1596 | } |
| 1597 | nLine++; /* record another line */ |
| 1598 | } |
| 1599 | db_reset(&fchngQuery); |
| 1600 | } |
| 1601 | } |
| 1602 | if( fchngQueryInit ) db_finalize(&fchngQuery); |
| @@ -1697,11 +1701,11 @@ | |
| 1701 | zLimit = find_option("count",0,1); |
| 1702 | } |
| 1703 | if( zLimit ){ |
| 1704 | n = atoi(zLimit); |
| 1705 | }else{ |
| 1706 | n = -20; |
| 1707 | } |
| 1708 | if( g.argc>=4 ){ |
| 1709 | k = strlen(g.argv[2]); |
| 1710 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1711 | mode = 1; |
| @@ -1776,17 +1780,14 @@ | |
| 1780 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1781 | } |
| 1782 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1783 | if(n>0){ |
| 1784 | blob_appendf(&sql, " LIMIT %d", n); |
| 1785 | } |
| 1786 | db_prepare(&q, blob_str(&sql)); |
| 1787 | blob_reset(&sql); |
| 1788 | print_timeline(&q, n<0?-n:0, verboseFlag); |
| 1789 | db_finalize(&q); |
| 1790 | } |
| 1791 | |
| 1792 | /* |
| 1793 | ** This is a version of the "localtime()" function from the standard |
| 1794 |