Fossil SCM
Now use a switch to specify the file/directory to the timeline command.
Commit
f24d85aee89d8558f9721dff22eae1b9c64d511b
Parent
e9bccd1c1270145…
1 file changed
+30
-28
+30
-28
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1702,11 +1702,11 @@ | ||
| 1702 | 1702 | } |
| 1703 | 1703 | |
| 1704 | 1704 | /* |
| 1705 | 1705 | ** COMMAND: timeline |
| 1706 | 1706 | ** |
| 1707 | -** Usage: %fossil timeline ?WHEN? ?BASELINE|DATETIME? ?OPTIONS? | |
| 1707 | +** Usage: %fossil timeline ?WHEN? ?CHECKIN|DATETIME? ?OPTIONS? | |
| 1708 | 1708 | ** |
| 1709 | 1709 | ** Print a summary of activity going backwards in date and time |
| 1710 | 1710 | ** specified or from the current date and time if no arguments |
| 1711 | 1711 | ** are given. The WHEN argument can be any unique abbreviation |
| 1712 | 1712 | ** of one of these keywords: |
| @@ -1722,10 +1722,12 @@ | ||
| 1722 | 1722 | ** for the current version or "now" for the current time. |
| 1723 | 1723 | ** |
| 1724 | 1724 | ** Options: |
| 1725 | 1725 | ** -n|--limit N Output the first N entries (default 20 lines). |
| 1726 | 1726 | ** N=0 means no limit. |
| 1727 | +** -p|--path PATH Output items affecting PATH only. | |
| 1728 | +** PATH can be a file or a sub directory. | |
| 1727 | 1729 | ** --offset P skip P changes |
| 1728 | 1730 | ** -t|--type TYPE Output items from the given types only, such as: |
| 1729 | 1731 | ** ci = file commits only |
| 1730 | 1732 | ** e = events only |
| 1731 | 1733 | ** t = tickets only |
| @@ -1763,10 +1765,12 @@ | ||
| 1763 | 1765 | } |
| 1764 | 1766 | db_find_and_open_repository(0, 0); |
| 1765 | 1767 | zLimit = find_option("limit","n",1); |
| 1766 | 1768 | zWidth = find_option("width","W",1); |
| 1767 | 1769 | zType = find_option("type","t",1); |
| 1770 | + zFilePattern = find_option("path","p",1); | |
| 1771 | + | |
| 1768 | 1772 | if( !zLimit ){ |
| 1769 | 1773 | zLimit = find_option("count",0,1); |
| 1770 | 1774 | } |
| 1771 | 1775 | if( zLimit ){ |
| 1772 | 1776 | n = atoi(zLimit); |
| @@ -1785,39 +1789,37 @@ | ||
| 1785 | 1789 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1786 | 1790 | |
| 1787 | 1791 | /* We should be done with options.. */ |
| 1788 | 1792 | verify_all_options(); |
| 1789 | 1793 | |
| 1790 | - zOrigin = "now"; | |
| 1791 | - zFilePattern = 0; | |
| 1792 | - for(i=2; i<g.argc; i++){ | |
| 1793 | - char *zArg = g.argv[i]; | |
| 1794 | - k = strlen(zArg); | |
| 1795 | - if( mode==0 ){ | |
| 1796 | - if( strncmp(zArg,"before",k)==0 ){ | |
| 1797 | - mode = 1; | |
| 1798 | - }else if( strncmp(zArg,"after",k)==0 && k>1 ){ | |
| 1799 | - mode = 2; | |
| 1800 | - }else if( strncmp(zArg,"descendants",k)==0 ){ | |
| 1801 | - mode = 3; | |
| 1802 | - }else if( strncmp(zArg,"children",k)==0 ){ | |
| 1803 | - mode = 3; | |
| 1804 | - }else if( strncmp(zArg,"ancestors",k)==0 && k>1 ){ | |
| 1805 | - mode = 4; | |
| 1806 | - }else if( strncmp(zArg,"parents",k)==0 ){ | |
| 1807 | - mode = 4; | |
| 1808 | - } | |
| 1809 | - if( mode ){ | |
| 1810 | - if( i<g.argc-1 ) zOrigin = g.argv[++i]; | |
| 1811 | - continue; | |
| 1812 | - } | |
| 1813 | - } | |
| 1814 | - if( zFilePattern==0 ){ | |
| 1815 | - zFilePattern = zArg; | |
| 1794 | + if( g.argc>=4 ){ | |
| 1795 | + k = strlen(g.argv[2]); | |
| 1796 | + if( strncmp(g.argv[2],"before",k)==0 ){ | |
| 1797 | + mode = 1; | |
| 1798 | + }else if( strncmp(g.argv[2],"after",k)==0 && k>1 ){ | |
| 1799 | + mode = 2; | |
| 1800 | + }else if( strncmp(g.argv[2],"descendants",k)==0 ){ | |
| 1801 | + mode = 3; | |
| 1802 | + }else if( strncmp(g.argv[2],"children",k)==0 ){ | |
| 1803 | + mode = 3; | |
| 1804 | + }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){ | |
| 1805 | + mode = 4; | |
| 1806 | + }else if( strncmp(g.argv[2],"parents",k)==0 ){ | |
| 1807 | + mode = 4; | |
| 1808 | + }else if(!zType && !zLimit){ | |
| 1809 | + usage("?WHEN? ?CHECKIN|DATETIME? ?-n|--limit #? ?-t|--type TYPE? " | |
| 1810 | + "?-W|--width WIDTH? ?-p|--path PATH"); | |
| 1811 | + } | |
| 1812 | + if( '-' != *g.argv[3] ){ | |
| 1813 | + zOrigin = g.argv[3]; | |
| 1816 | 1814 | }else{ |
| 1817 | - usage("?WHEN? ?CHECKIN|DATETIME? ?FILE? ?OPTIONS?"); | |
| 1815 | + zOrigin = "now"; | |
| 1818 | 1816 | } |
| 1817 | + }else if( g.argc==3 ){ | |
| 1818 | + zOrigin = g.argv[2]; | |
| 1819 | + }else{ | |
| 1820 | + zOrigin = "now"; | |
| 1819 | 1821 | } |
| 1820 | 1822 | k = strlen(zOrigin); |
| 1821 | 1823 | blob_zero(&uuid); |
| 1822 | 1824 | blob_append(&uuid, zOrigin, -1); |
| 1823 | 1825 | if( fossil_strcmp(zOrigin, "now")==0 ){ |
| 1824 | 1826 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1702,11 +1702,11 @@ | |
| 1702 | } |
| 1703 | |
| 1704 | /* |
| 1705 | ** COMMAND: timeline |
| 1706 | ** |
| 1707 | ** Usage: %fossil timeline ?WHEN? ?BASELINE|DATETIME? ?OPTIONS? |
| 1708 | ** |
| 1709 | ** Print a summary of activity going backwards in date and time |
| 1710 | ** specified or from the current date and time if no arguments |
| 1711 | ** are given. The WHEN argument can be any unique abbreviation |
| 1712 | ** of one of these keywords: |
| @@ -1722,10 +1722,12 @@ | |
| 1722 | ** for the current version or "now" for the current time. |
| 1723 | ** |
| 1724 | ** Options: |
| 1725 | ** -n|--limit N Output the first N entries (default 20 lines). |
| 1726 | ** N=0 means no limit. |
| 1727 | ** --offset P skip P changes |
| 1728 | ** -t|--type TYPE Output items from the given types only, such as: |
| 1729 | ** ci = file commits only |
| 1730 | ** e = events only |
| 1731 | ** t = tickets only |
| @@ -1763,10 +1765,12 @@ | |
| 1763 | } |
| 1764 | db_find_and_open_repository(0, 0); |
| 1765 | zLimit = find_option("limit","n",1); |
| 1766 | zWidth = find_option("width","W",1); |
| 1767 | zType = find_option("type","t",1); |
| 1768 | if( !zLimit ){ |
| 1769 | zLimit = find_option("count",0,1); |
| 1770 | } |
| 1771 | if( zLimit ){ |
| 1772 | n = atoi(zLimit); |
| @@ -1785,39 +1789,37 @@ | |
| 1785 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1786 | |
| 1787 | /* We should be done with options.. */ |
| 1788 | verify_all_options(); |
| 1789 | |
| 1790 | zOrigin = "now"; |
| 1791 | zFilePattern = 0; |
| 1792 | for(i=2; i<g.argc; i++){ |
| 1793 | char *zArg = g.argv[i]; |
| 1794 | k = strlen(zArg); |
| 1795 | if( mode==0 ){ |
| 1796 | if( strncmp(zArg,"before",k)==0 ){ |
| 1797 | mode = 1; |
| 1798 | }else if( strncmp(zArg,"after",k)==0 && k>1 ){ |
| 1799 | mode = 2; |
| 1800 | }else if( strncmp(zArg,"descendants",k)==0 ){ |
| 1801 | mode = 3; |
| 1802 | }else if( strncmp(zArg,"children",k)==0 ){ |
| 1803 | mode = 3; |
| 1804 | }else if( strncmp(zArg,"ancestors",k)==0 && k>1 ){ |
| 1805 | mode = 4; |
| 1806 | }else if( strncmp(zArg,"parents",k)==0 ){ |
| 1807 | mode = 4; |
| 1808 | } |
| 1809 | if( mode ){ |
| 1810 | if( i<g.argc-1 ) zOrigin = g.argv[++i]; |
| 1811 | continue; |
| 1812 | } |
| 1813 | } |
| 1814 | if( zFilePattern==0 ){ |
| 1815 | zFilePattern = zArg; |
| 1816 | }else{ |
| 1817 | usage("?WHEN? ?CHECKIN|DATETIME? ?FILE? ?OPTIONS?"); |
| 1818 | } |
| 1819 | } |
| 1820 | k = strlen(zOrigin); |
| 1821 | blob_zero(&uuid); |
| 1822 | blob_append(&uuid, zOrigin, -1); |
| 1823 | if( fossil_strcmp(zOrigin, "now")==0 ){ |
| 1824 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1702,11 +1702,11 @@ | |
| 1702 | } |
| 1703 | |
| 1704 | /* |
| 1705 | ** COMMAND: timeline |
| 1706 | ** |
| 1707 | ** Usage: %fossil timeline ?WHEN? ?CHECKIN|DATETIME? ?OPTIONS? |
| 1708 | ** |
| 1709 | ** Print a summary of activity going backwards in date and time |
| 1710 | ** specified or from the current date and time if no arguments |
| 1711 | ** are given. The WHEN argument can be any unique abbreviation |
| 1712 | ** of one of these keywords: |
| @@ -1722,10 +1722,12 @@ | |
| 1722 | ** for the current version or "now" for the current time. |
| 1723 | ** |
| 1724 | ** Options: |
| 1725 | ** -n|--limit N Output the first N entries (default 20 lines). |
| 1726 | ** N=0 means no limit. |
| 1727 | ** -p|--path PATH Output items affecting PATH only. |
| 1728 | ** PATH can be a file or a sub directory. |
| 1729 | ** --offset P skip P changes |
| 1730 | ** -t|--type TYPE Output items from the given types only, such as: |
| 1731 | ** ci = file commits only |
| 1732 | ** e = events only |
| 1733 | ** t = tickets only |
| @@ -1763,10 +1765,12 @@ | |
| 1765 | } |
| 1766 | db_find_and_open_repository(0, 0); |
| 1767 | zLimit = find_option("limit","n",1); |
| 1768 | zWidth = find_option("width","W",1); |
| 1769 | zType = find_option("type","t",1); |
| 1770 | zFilePattern = find_option("path","p",1); |
| 1771 | |
| 1772 | if( !zLimit ){ |
| 1773 | zLimit = find_option("count",0,1); |
| 1774 | } |
| 1775 | if( zLimit ){ |
| 1776 | n = atoi(zLimit); |
| @@ -1785,39 +1789,37 @@ | |
| 1789 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1790 | |
| 1791 | /* We should be done with options.. */ |
| 1792 | verify_all_options(); |
| 1793 | |
| 1794 | if( g.argc>=4 ){ |
| 1795 | k = strlen(g.argv[2]); |
| 1796 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1797 | mode = 1; |
| 1798 | }else if( strncmp(g.argv[2],"after",k)==0 && k>1 ){ |
| 1799 | mode = 2; |
| 1800 | }else if( strncmp(g.argv[2],"descendants",k)==0 ){ |
| 1801 | mode = 3; |
| 1802 | }else if( strncmp(g.argv[2],"children",k)==0 ){ |
| 1803 | mode = 3; |
| 1804 | }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){ |
| 1805 | mode = 4; |
| 1806 | }else if( strncmp(g.argv[2],"parents",k)==0 ){ |
| 1807 | mode = 4; |
| 1808 | }else if(!zType && !zLimit){ |
| 1809 | usage("?WHEN? ?CHECKIN|DATETIME? ?-n|--limit #? ?-t|--type TYPE? " |
| 1810 | "?-W|--width WIDTH? ?-p|--path PATH"); |
| 1811 | } |
| 1812 | if( '-' != *g.argv[3] ){ |
| 1813 | zOrigin = g.argv[3]; |
| 1814 | }else{ |
| 1815 | zOrigin = "now"; |
| 1816 | } |
| 1817 | }else if( g.argc==3 ){ |
| 1818 | zOrigin = g.argv[2]; |
| 1819 | }else{ |
| 1820 | zOrigin = "now"; |
| 1821 | } |
| 1822 | k = strlen(zOrigin); |
| 1823 | blob_zero(&uuid); |
| 1824 | blob_append(&uuid, zOrigin, -1); |
| 1825 | if( fossil_strcmp(zOrigin, "now")==0 ){ |
| 1826 |