| | @@ -1683,33 +1683,38 @@ |
| 1683 | 1683 | ** for the current version or "now" for the current time. |
| 1684 | 1684 | ** |
| 1685 | 1685 | ** Options: |
| 1686 | 1686 | ** -n|--limit N Output the first N entries (default 20 lines). |
| 1687 | 1687 | ** N=0 means no limit. |
| 1688 | +** --offset P skip P changes |
| 1688 | 1689 | ** -t|--type TYPE Output items from the given types only, such as: |
| 1689 | 1690 | ** ci = file commits only |
| 1690 | 1691 | ** e = events only |
| 1691 | 1692 | ** t = tickets only |
| 1692 | 1693 | ** w = wiki commits only |
| 1693 | 1694 | ** -v|--verbose Output the list of files changed by each commit |
| 1694 | 1695 | ** and the type of each change (edited, deleted, |
| 1695 | 1696 | ** etc.) after the checkin comment. |
| 1696 | | -** -W|--width <num> With of lines (default 79). Must be >20 or 0. |
| 1697 | +** -W|--width <num> With of lines (default 79). Must be >20 or 0 |
| 1698 | +** (= no limit, resulting in a single line per entry). |
| 1697 | 1699 | */ |
| 1698 | 1700 | void timeline_cmd(void){ |
| 1699 | 1701 | Stmt q; |
| 1700 | 1702 | int n, k, width; |
| 1701 | 1703 | const char *zLimit; |
| 1702 | 1704 | const char *zWidth; |
| 1705 | + const char *zOffset; |
| 1703 | 1706 | const char *zType; |
| 1704 | 1707 | char *zOrigin; |
| 1705 | 1708 | char *zDate; |
| 1706 | 1709 | Blob sql; |
| 1707 | 1710 | int objid = 0; |
| 1708 | 1711 | Blob uuid; |
| 1709 | 1712 | int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */ |
| 1710 | 1713 | int verboseFlag = 0 ; |
| 1714 | + int iOffset; |
| 1715 | + |
| 1711 | 1716 | verboseFlag = find_option("verbose","v", 0)!=0; |
| 1712 | 1717 | if( !verboseFlag){ |
| 1713 | 1718 | verboseFlag = find_option("showfiles","f", 0)!=0; /* deprecated */ |
| 1714 | 1719 | } |
| 1715 | 1720 | db_find_and_open_repository(0, 0); |
| | @@ -1730,10 +1735,12 @@ |
| 1730 | 1735 | fossil_fatal("--width|-W value must be >20 or 0"); |
| 1731 | 1736 | } |
| 1732 | 1737 | }else{ |
| 1733 | 1738 | width = 79; |
| 1734 | 1739 | } |
| 1740 | + zOffset = find_option("offset",0,1); |
| 1741 | + iOffset = zOffset ? atoi(zOffset) : 0; |
| 1735 | 1742 | if( g.argc>=4 ){ |
| 1736 | 1743 | k = strlen(g.argv[2]); |
| 1737 | 1744 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1738 | 1745 | mode = 1; |
| 1739 | 1746 | }else if( strncmp(g.argv[2],"after",k)==0 && k>1 ){ |
| | @@ -1805,10 +1812,13 @@ |
| 1805 | 1812 | } |
| 1806 | 1813 | if( zType && (zType[0]!='a') ){ |
| 1807 | 1814 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1808 | 1815 | } |
| 1809 | 1816 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1817 | + if( iOffset>0 ){ |
| 1818 | + blob_appendf(&sql, " LIMIT %d OFFSET %d", n>0?n+1:99999, iOffset); |
| 1819 | + } |
| 1810 | 1820 | db_prepare(&q, blob_str(&sql)); |
| 1811 | 1821 | blob_reset(&sql); |
| 1812 | 1822 | print_timeline(&q, n, width, verboseFlag); |
| 1813 | 1823 | db_finalize(&q); |
| 1814 | 1824 | } |
| 1815 | 1825 | |