~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-01-29 07:18:57 UTC
  • mfrom: (3970.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090129071857-l3ikkrm6b1rx96bx
log -n/--levels (Ian Clatworthy)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1818
1818
        raise errors.BzrCommandError(msg)
1819
1819
 
1820
1820
 
 
1821
def _parse_levels(s):
 
1822
    try:
 
1823
        return int(s)
 
1824
    except ValueError:
 
1825
        msg = "The levels argument must be an integer."
 
1826
        raise errors.BzrCommandError(msg)
 
1827
 
 
1828
 
1821
1829
class cmd_log(Command):
1822
1830
    """Show log of a branch, file, or directory.
1823
1831
 
1858
1866
                   help='Show just the specified revision.'
1859
1867
                   ' See also "help revisionspec".'),
1860
1868
            'log-format',
 
1869
            Option('levels',
 
1870
                   short_name='n',
 
1871
                   help='Number of levels to display - 0 for all, 1 for flat.',
 
1872
                   argname='N',
 
1873
                   type=_parse_levels),
1861
1874
            Option('message',
1862
1875
                   short_name='m',
1863
1876
                   help='Show revisions whose message matches this '
1882
1895
            revision=None,
1883
1896
            change=None,
1884
1897
            log_format=None,
 
1898
            levels=None,
1885
1899
            message=None,
1886
1900
            limit=None,
1887
1901
            show_diff=False):
1931
1945
 
1932
1946
            lf = log_format(show_ids=show_ids, to_file=self.outf,
1933
1947
                            show_timezone=timezone,
1934
 
                            delta_format=get_verbosity_level())
 
1948
                            delta_format=get_verbosity_level(),
 
1949
                            levels=levels)
1935
1950
 
1936
1951
            show_log(b,
1937
1952
                     lf,