| | @@ -1675,15 +1675,17 @@ |
| 1675 | 1675 | ** t = tickets only |
| 1676 | 1676 | ** w = wiki commits only |
| 1677 | 1677 | ** -v|--verbose Output the list of files changed by each commit |
| 1678 | 1678 | ** and the type of each change (edited, deleted, |
| 1679 | 1679 | ** etc.) after the checkin comment. |
| 1680 | +** -W|--width <num> With of lines (default 79). Must be >20 or 0. |
| 1680 | 1681 | */ |
| 1681 | 1682 | void timeline_cmd(void){ |
| 1682 | 1683 | Stmt q; |
| 1683 | | - int n, k; |
| 1684 | + int n, k, width; |
| 1684 | 1685 | const char *zLimit; |
| 1686 | + const char *zWidth; |
| 1685 | 1687 | const char *zType; |
| 1686 | 1688 | char *zOrigin; |
| 1687 | 1689 | char *zDate; |
| 1688 | 1690 | Blob sql; |
| 1689 | 1691 | int objid = 0; |
| | @@ -1694,18 +1696,27 @@ |
| 1694 | 1696 | if( !verboseFlag){ |
| 1695 | 1697 | verboseFlag = find_option("showfiles","f", 0)!=0; /* deprecated */ |
| 1696 | 1698 | } |
| 1697 | 1699 | db_find_and_open_repository(0, 0); |
| 1698 | 1700 | zLimit = find_option("limit","n",1); |
| 1701 | + zWidth = find_option("width","W",1); |
| 1699 | 1702 | zType = find_option("type","t",1); |
| 1700 | 1703 | if ( !zLimit ){ |
| 1701 | 1704 | zLimit = find_option("count",0,1); |
| 1702 | 1705 | } |
| 1703 | 1706 | if( zLimit ){ |
| 1704 | 1707 | n = atoi(zLimit); |
| 1705 | 1708 | }else{ |
| 1706 | 1709 | n = 20; |
| 1710 | + } |
| 1711 | + if( zWidth ){ |
| 1712 | + width = atoi(zWidth); |
| 1713 | + if( (width!=0) && (width<=20) ){ |
| 1714 | + fossil_fatal("--width|-W value must be >20 or 0"); |
| 1715 | + } |
| 1716 | + }else{ |
| 1717 | + width = 79; |
| 1707 | 1718 | } |
| 1708 | 1719 | if( g.argc>=4 ){ |
| 1709 | 1720 | k = strlen(g.argv[2]); |
| 1710 | 1721 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1711 | 1722 | mode = 1; |
| | @@ -1718,11 +1729,11 @@ |
| 1718 | 1729 | }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){ |
| 1719 | 1730 | mode = 4; |
| 1720 | 1731 | }else if( strncmp(g.argv[2],"parents",k)==0 ){ |
| 1721 | 1732 | mode = 4; |
| 1722 | 1733 | }else if(!zType && !zLimit){ |
| 1723 | | - usage("?WHEN? ?BASELINE|DATETIME? ?-n|--limit N? ?-t|--type TYPE?"); |
| 1734 | + usage("?WHEN? ?BASELINE|DATETIME? ?-n|--limit N? ?-t|--type TYPE? ?-W|--width WIDTH?"); |
| 1724 | 1735 | } |
| 1725 | 1736 | if( '-' != *g.argv[3] ){ |
| 1726 | 1737 | zOrigin = g.argv[3]; |
| 1727 | 1738 | }else{ |
| 1728 | 1739 | zOrigin = "now"; |
| | @@ -1780,11 +1791,11 @@ |
| 1780 | 1791 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1781 | 1792 | } |
| 1782 | 1793 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1783 | 1794 | db_prepare(&q, blob_str(&sql)); |
| 1784 | 1795 | blob_reset(&sql); |
| 1785 | | - print_timeline(&q, n, 79, verboseFlag); |
| 1796 | + print_timeline(&q, n, width, verboseFlag); |
| 1786 | 1797 | db_finalize(&q); |
| 1787 | 1798 | } |
| 1788 | 1799 | |
| 1789 | 1800 | /* |
| 1790 | 1801 | ** This is a version of the "localtime()" function from the standard |
| 1791 | 1802 | |