graphlog.py
58 lines
| 2.1 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 | ||||
since version 2.3. | ||||
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 | |||
from mercurial.i18n import _ | ||||
Patrick Mezard
|
r17182 | from mercurial import cmdutil, commands | ||
Steve Borho
|
r5938 | |||
Adrian Buehlmann
|
r14311 | cmdtable = {} | ||
command = cmdutil.command(cmdtable) | ||||
Augie Fackler
|
r16743 | testedwith = 'internal' | ||
Adrian Buehlmann
|
r14311 | |||
@command('glog', | ||||
Patrick Mezard
|
r16432 | [('f', 'follow', None, | ||
_('follow changeset history, or file history across copies and renames')), | ||||
('', 'follow-first', None, | ||||
_('only follow the first parent of merge changesets (DEPRECATED)')), | ||||
('d', 'date', '', _('show revisions matching date spec'), _('DATE')), | ||||
('C', 'copies', None, _('show copied files')), | ||||
('k', 'keyword', [], | ||||
_('do case-insensitive search for a given text'), _('TEXT')), | ||||
Jordi GutiƩrrez Hermoso
|
r23091 | ('r', 'rev', [], _('show the specified revision or revset'), _('REV')), | ||
Patrick Mezard
|
r16432 | ('', 'removed', None, _('include revisions where files were removed')), | ||
('m', 'only-merges', None, _('show only merges (DEPRECATED)')), | ||||
('u', 'user', [], _('revisions committed by user'), _('USER')), | ||||
('', 'only-branch', [], | ||||
_('show only changesets within the given named branch (DEPRECATED)'), | ||||
_('BRANCH')), | ||||
('b', 'branch', [], | ||||
_('show changesets within the given named branch'), _('BRANCH')), | ||||
('P', 'prune', [], | ||||
_('do not display revision or any of its ancestors'), _('REV')), | ||||
] + commands.logopts + commands.walkopts, | ||||
Gregory Szorc
|
r21782 | _('[OPTION]... [FILE]'), | ||
inferrepo=True) | ||||
Alexander Solovyov
|
r14043 | def graphlog(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. | ||||
Peter Arrenbrecht
|
r7325 | """ | ||
Yuya Nishihara
|
r24200 | opts['graph'] = True | ||
return commands.log(ui, repo, *pats, **opts) | ||||