graphlog.py
125 lines
| 3.3 KiB
| text/x-python
|
PythonLexer
/ hgext / graphlog.py
Joel Rosdahl
|
r4344 | # ASCII graph log extension for Mercurial | ||
# | ||||
# Copyright 2007 Joel Rosdahl <joel@rosdahl.net> | ||||
Thomas Arendsen Hein
|
r4516 | # | ||
Martin Geisler
|
r8225 | # This software may be used and distributed according to the terms of the | ||
Matt Mackall
|
r10263 | # GNU General Public License version 2 or any later version. | ||
Martin Geisler
|
r8228 | |||
Martin Geisler
|
r20118 | '''command to view revision graphs from a shell (DEPRECATED) | ||
The functionality of this extension has been include in core Mercurial | ||||
timeless
|
r27715 | since version 2.3. Please use :hg:`log -G ...` instead. | ||
Alpar Juttner
|
r7426 | |||
This extension adds a --graph option to the incoming, outgoing and log | ||||
Martin Geisler
|
r9259 | commands. When this options is given, an ASCII representation of the | ||
revision graph is also shown. | ||||
Alpar Juttner
|
r7426 | ''' | ||
Joel Rosdahl
|
r4344 | |||
Pulkit Goyal
|
r29123 | from __future__ import absolute_import | ||
Joel Rosdahl
|
r4344 | from mercurial.i18n import _ | ||
Pulkit Goyal
|
r29123 | from mercurial import ( | ||
Yuya Nishihara
|
r32375 | cmdutil, | ||
Pulkit Goyal
|
r29123 | commands, | ||
Yuya Nishihara
|
r32337 | registrar, | ||
Pulkit Goyal
|
r29123 | ) | ||
Steve Borho
|
r5938 | |||
Adrian Buehlmann
|
r14311 | cmdtable = {} | ||
Yuya Nishihara
|
r32337 | command = registrar.command(cmdtable) | ||
Augie Fackler
|
r29841 | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | ||
Augie Fackler
|
r25186 | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | ||
# be specifying the version(s) of Mercurial they are tested with, or | ||||
# leave the attribute unspecified. | ||||
Augie Fackler
|
r43347 | testedwith = b'ships-with-hg-core' | ||
Adrian Buehlmann
|
r14311 | |||
Augie Fackler
|
r43346 | |||
@command( | ||||
Augie Fackler
|
r43347 | b'glog', | ||
Augie Fackler
|
r43346 | [ | ||
( | ||||
Augie Fackler
|
r43347 | b'f', | ||
b'follow', | ||||
Augie Fackler
|
r43346 | None, | ||
_( | ||||
Augie Fackler
|
r43347 | b'follow changeset history, or file history across copies and renames' | ||
Augie Fackler
|
r43346 | ), | ||
), | ||||
( | ||||
Augie Fackler
|
r43347 | b'', | ||
b'follow-first', | ||||
Augie Fackler
|
r43346 | None, | ||
Augie Fackler
|
r43347 | _(b'only follow the first parent of merge changesets (DEPRECATED)'), | ||
Augie Fackler
|
r43346 | ), | ||
( | ||||
Augie Fackler
|
r43347 | b'd', | ||
b'date', | ||||
b'', | ||||
_(b'show revisions matching date spec'), | ||||
_(b'DATE'), | ||||
), | ||||
(b'C', b'copies', None, _(b'show copied files')), | ||||
( | ||||
b'k', | ||||
b'keyword', | ||||
Augie Fackler
|
r43346 | [], | ||
Augie Fackler
|
r43347 | _(b'do case-insensitive search for a given text'), | ||
_(b'TEXT'), | ||||
), | ||||
( | ||||
b'r', | ||||
b'rev', | ||||
[], | ||||
_(b'show the specified revision or revset'), | ||||
_(b'REV'), | ||||
Augie Fackler
|
r43346 | ), | ||
( | ||||
Augie Fackler
|
r43347 | b'', | ||
b'removed', | ||||
None, | ||||
_(b'include revisions where files were removed'), | ||||
), | ||||
(b'm', b'only-merges', None, _(b'show only merges (DEPRECATED)')), | ||||
(b'u', b'user', [], _(b'revisions committed by user'), _(b'USER')), | ||||
( | ||||
b'', | ||||
b'only-branch', | ||||
Augie Fackler
|
r43346 | [], | ||
_( | ||||
Augie Fackler
|
r43347 | b'show only changesets within the given named branch (DEPRECATED)' | ||
Augie Fackler
|
r43346 | ), | ||
Augie Fackler
|
r43347 | _(b'BRANCH'), | ||
Augie Fackler
|
r43346 | ), | ||
( | ||||
Augie Fackler
|
r43347 | b'b', | ||
b'branch', | ||||
Augie Fackler
|
r43346 | [], | ||
Augie Fackler
|
r43347 | _(b'show changesets within the given named branch'), | ||
_(b'BRANCH'), | ||||
Augie Fackler
|
r43346 | ), | ||
( | ||||
Augie Fackler
|
r43347 | b'P', | ||
b'prune', | ||||
Augie Fackler
|
r43346 | [], | ||
Augie Fackler
|
r43347 | _(b'do not display revision or any of its ancestors'), | ||
_(b'REV'), | ||||
Augie Fackler
|
r43346 | ), | ||
] | ||||
+ cmdutil.logopts | ||||
+ cmdutil.walkopts, | ||||
Augie Fackler
|
r43347 | _(b'[OPTION]... [FILE]'), | ||
rdamazio@google.com
|
r40329 | helpcategory=command.CATEGORY_CHANGE_NAVIGATION, | ||
Augie Fackler
|
r43346 | inferrepo=True, | ||
) | ||||
timeless
|
r27149 | def glog(ui, repo, *pats, **opts): | ||
Peter Arrenbrecht
|
r7325 | """show revision history alongside an ASCII revision graph | ||
Martin Geisler
|
r9259 | Print a revision history alongside a revision graph drawn with | ||
ASCII characters. | ||||
Peter Arrenbrecht
|
r7325 | |||
Martin Geisler
|
r9259 | Nodes printed as an @ character are parents of the working | ||
directory. | ||||
timeless
|
r27715 | |||
This is an alias to :hg:`log -G`. | ||||
Peter Arrenbrecht
|
r7325 | """ | ||
Augie Fackler
|
r43906 | opts['graph'] = True | ||
Yuya Nishihara
|
r24200 | return commands.log(ui, repo, *pats, **opts) | ||