Fossil SCM

Now use a switch to specify the file/directory to the timeline command.

mistachkin 2014-10-22 20:00 trunk merge
Commit f24d85aee89d8558f9721dff22eae1b9c64d511b
1 file changed +30 -28
+30 -28
--- src/timeline.c
+++ src/timeline.c
@@ -1702,11 +1702,11 @@
17021702
}
17031703
17041704
/*
17051705
** COMMAND: timeline
17061706
**
1707
-** Usage: %fossil timeline ?WHEN? ?BASELINE|DATETIME? ?OPTIONS?
1707
+** Usage: %fossil timeline ?WHEN? ?CHECKIN|DATETIME? ?OPTIONS?
17081708
**
17091709
** Print a summary of activity going backwards in date and time
17101710
** specified or from the current date and time if no arguments
17111711
** are given. The WHEN argument can be any unique abbreviation
17121712
** of one of these keywords:
@@ -1722,10 +1722,12 @@
17221722
** for the current version or "now" for the current time.
17231723
**
17241724
** Options:
17251725
** -n|--limit N Output the first N entries (default 20 lines).
17261726
** N=0 means no limit.
1727
+** -p|--path PATH Output items affecting PATH only.
1728
+** PATH can be a file or a sub directory.
17271729
** --offset P skip P changes
17281730
** -t|--type TYPE Output items from the given types only, such as:
17291731
** ci = file commits only
17301732
** e = events only
17311733
** t = tickets only
@@ -1763,10 +1765,12 @@
17631765
}
17641766
db_find_and_open_repository(0, 0);
17651767
zLimit = find_option("limit","n",1);
17661768
zWidth = find_option("width","W",1);
17671769
zType = find_option("type","t",1);
1770
+ zFilePattern = find_option("path","p",1);
1771
+
17681772
if( !zLimit ){
17691773
zLimit = find_option("count",0,1);
17701774
}
17711775
if( zLimit ){
17721776
n = atoi(zLimit);
@@ -1785,39 +1789,37 @@
17851789
iOffset = zOffset ? atoi(zOffset) : 0;
17861790
17871791
/* We should be done with options.. */
17881792
verify_all_options();
17891793
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];
18161814
}else{
1817
- usage("?WHEN? ?CHECKIN|DATETIME? ?FILE? ?OPTIONS?");
1815
+ zOrigin = "now";
18181816
}
1817
+ }else if( g.argc==3 ){
1818
+ zOrigin = g.argv[2];
1819
+ }else{
1820
+ zOrigin = "now";
18191821
}
18201822
k = strlen(zOrigin);
18211823
blob_zero(&uuid);
18221824
blob_append(&uuid, zOrigin, -1);
18231825
if( fossil_strcmp(zOrigin, "now")==0 ){
18241826
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button