Fossil

Check-in [1e870e1e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

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

- Use -p|--path PATH since "-f" is already used as a deprecated options.

- Restore command line arguments parsing of the timeline command as before the cmdline-timeline-enhancement branch so the previous behavior and argument priority stay compatible as before.

(We were not able to specify a checkin prefix or tagname without specifying the ?WHEN? argument anymore.)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | cmdline-timeline-enhancement
Files: files | file ages | folders
SHA1:1e870e1e06c202a855afcd364826b35dbdb6d8ef
User & Date: mgagnon 2014-10-20 21:37:15
Context
2014-10-21
03:12
Merge updates from trunk. Closed-Leaf check-in: 22a74690 user: mistachkin tags: cmdline-timeline-enhancement
2014-10-20
21:37
Now use a switch to specify the file/directory to the timeline command.

- Use -p|--path PATH since "-f" is already used as a deprecated options.

- Restore command line arguments parsing of the timeline command as before the cmdline-timeline-enhancement branch so the previous behavior and argument priority stay compatible as before.

(We were not able to specify a checkin prefix or tagname without specifying the ?WHEN? argument anymore.)
check-in: 1e870e1e user: mgagnon tags: cmdline-timeline-enhancement
16:31
Reverse the output order for the "fossil stash list" command so that the most resent stashes are near the bottom, rather than scrolling off the top of the screen. check-in: cf9eac39 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/timeline.c.

1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
....
1716
1717
1718
1719
1720
1721
1722


1723
1724
1725
1726
1727
1728
1729
....
1757
1758
1759
1760
1761
1762
1763


1764
1765
1766
1767
1768
1769
1770
....
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803



1804
1805

1806

1807
1808
1809
1810
1811
1812
1813
1814

1815
1816
1817
1818
1819
1820
1821
      && fossil_isdigit(z[0])
      && fossil_isdigit(z[5]);
}

/*
** COMMAND: timeline
**
** Usage: %fossil timeline ?WHEN? ?BASELINE|DATETIME? ?OPTIONS?
**
** Print a summary of activity going backwards in date and time
** specified or from the current date and time if no arguments
** are given.  The WHEN argument can be any unique abbreviation
** of one of these keywords:
**
**     before
................................................................................
** The DATETIME should be in the ISO8601 format.  For
** examples: "2007-08-18 07:21:21".  You can also say "current"
** for the current version or "now" for the current time.
**
** Options:
**   -n|--limit N         Output the first N entries (default 20 lines).
**                        N=0 means no limit.


**   --offset P           skip P changes
**   -t|--type TYPE       Output items from the given types only, such as:
**                            ci = file commits only
**                            e  = events only
**                            t  = tickets only
**                            w  = wiki commits only
**   -v|--verbose         Output the list of files changed by each commit
................................................................................
  if( !verboseFlag){
    verboseFlag = find_option("showfiles","f", 0)!=0; /* deprecated */
  }
  db_find_and_open_repository(0, 0);
  zLimit = find_option("limit","n",1);
  zWidth = find_option("width","W",1);
  zType = find_option("type","t",1);


  if( !zLimit ){
    zLimit = find_option("count",0,1);
  }
  if( zLimit ){
    n = atoi(zLimit);
  }else{
    n = -20;
................................................................................
  }
  zOffset = find_option("offset",0,1);
  iOffset = zOffset ? atoi(zOffset) : 0;

  /* We should be done with options.. */
  verify_all_options();

  zOrigin = "now";
  zFilePattern = 0;
  for(i=2; i<g.argc; i++){
    char *zArg = g.argv[i];
    k = strlen(zArg);
    if( mode==0 ){
      if( strncmp(zArg,"before",k)==0 ){
        mode = 1;
      }else if( strncmp(zArg,"after",k)==0 && k>1 ){
        mode = 2;
      }else if( strncmp(zArg,"descendants",k)==0 ){
        mode = 3;
      }else if( strncmp(zArg,"children",k)==0 ){
        mode = 3;
      }else if( strncmp(zArg,"ancestors",k)==0 && k>1 ){
        mode = 4;
      }else if( strncmp(zArg,"parents",k)==0 ){
        mode = 4;



      }
      if( mode ){

        if( i<g.argc-1 ) zOrigin = g.argv[++i];

        continue;
      }
    }
    if( zFilePattern==0 ){
      zFilePattern = zArg;
    }else{
      usage("?WHEN? ?CHECKIN|DATETIME? ?FILE? ?OPTIONS?");
    }

  }
  k = strlen(zOrigin);
  blob_zero(&uuid);
  blob_append(&uuid, zOrigin, -1);
  if( fossil_strcmp(zOrigin, "now")==0 ){
    if( mode==3 || mode==4 ){
      fossil_fatal("cannot compute descendants or ancestors of a date");







|







 







>
>







 







>
>







 







|
<
<
<
|
<
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
|
<
>
|
>
|
|
|
|
<
|
<
<
>







1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
....
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
....
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
....
1783
1784
1785
1786
1787
1788
1789
1790



1791

1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807

1808
1809
1810
1811
1812
1813
1814

1815


1816
1817
1818
1819
1820
1821
1822
1823
      && fossil_isdigit(z[0])
      && fossil_isdigit(z[5]);
}

/*
** COMMAND: timeline
**
** Usage: %fossil timeline ?WHEN? ?CHECKIN|DATETIME? ?OPTIONS?
**
** Print a summary of activity going backwards in date and time
** specified or from the current date and time if no arguments
** are given.  The WHEN argument can be any unique abbreviation
** of one of these keywords:
**
**     before
................................................................................
** The DATETIME should be in the ISO8601 format.  For
** examples: "2007-08-18 07:21:21".  You can also say "current"
** for the current version or "now" for the current time.
**
** Options:
**   -n|--limit N         Output the first N entries (default 20 lines).
**                        N=0 means no limit.
**   -p|--path PATH       Output items affecting PATH only. 
**                        PATH can be a file or a sub directory.
**   --offset P           skip P changes
**   -t|--type TYPE       Output items from the given types only, such as:
**                            ci = file commits only
**                            e  = events only
**                            t  = tickets only
**                            w  = wiki commits only
**   -v|--verbose         Output the list of files changed by each commit
................................................................................
  if( !verboseFlag){
    verboseFlag = find_option("showfiles","f", 0)!=0; /* deprecated */
  }
  db_find_and_open_repository(0, 0);
  zLimit = find_option("limit","n",1);
  zWidth = find_option("width","W",1);
  zType = find_option("type","t",1);
  zFilePattern = find_option("path","p",1);

  if( !zLimit ){
    zLimit = find_option("count",0,1);
  }
  if( zLimit ){
    n = atoi(zLimit);
  }else{
    n = -20;
................................................................................
  }
  zOffset = find_option("offset",0,1);
  iOffset = zOffset ? atoi(zOffset) : 0;

  /* We should be done with options.. */
  verify_all_options();

  if( g.argc>=4 ){



    k = strlen(g.argv[2]);

    if( strncmp(g.argv[2],"before",k)==0 ){
      mode = 1;
    }else if( strncmp(g.argv[2],"after",k)==0 && k>1 ){
      mode = 2;
    }else if( strncmp(g.argv[2],"descendants",k)==0 ){
      mode = 3;
    }else if( strncmp(g.argv[2],"children",k)==0 ){
      mode = 3;
    }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){
      mode = 4;
    }else if( strncmp(g.argv[2],"parents",k)==0 ){
      mode = 4;
    }else if(!zType && !zLimit){
      usage("?WHEN? ?CHECKIN|DATETIME? ?-n|--limit #? ?-t|--type TYPE? "
            "?-W|--width WIDTH? ?-p|--path PATH");
    }

    if( '-' != *g.argv[3] ){
      zOrigin = g.argv[3];
    }else{
      zOrigin = "now";
    }
  }else if( g.argc==3 ){
    zOrigin = g.argv[2];

  }else{


    zOrigin = "now";
  }
  k = strlen(zOrigin);
  blob_zero(&uuid);
  blob_append(&uuid, zOrigin, -1);
  if( fossil_strcmp(zOrigin, "now")==0 ){
    if( mode==3 || mode==4 ){
      fossil_fatal("cannot compute descendants or ancestors of a date");