2007-04-09 12:39:28 +04:00
|
|
|
# ASCII graph log extension for Mercurial
|
|
|
|
#
|
|
|
|
# Copyright 2007 Joel Rosdahl <joel@rosdahl.net>
|
2007-06-06 22:22:52 +04:00
|
|
|
#
|
2009-04-26 03:08:54 +04:00
|
|
|
# This software may be used and distributed according to the terms of the
|
2010-01-20 07:20:08 +03:00
|
|
|
# GNU General Public License version 2 or any later version.
|
2009-04-26 03:25:53 +04:00
|
|
|
|
2009-06-24 15:42:02 +04:00
|
|
|
'''command to view revision graphs from a shell
|
2008-11-22 01:27:11 +03:00
|
|
|
|
|
|
|
This extension adds a --graph option to the incoming, outgoing and log
|
2009-07-26 03:46:28 +04:00
|
|
|
commands. When this options is given, an ASCII representation of the
|
|
|
|
revision graph is also shown.
|
2008-11-22 01:27:11 +03:00
|
|
|
'''
|
2007-04-09 12:39:28 +04:00
|
|
|
|
|
|
|
from mercurial.i18n import _
|
2012-07-11 20:22:07 +04:00
|
|
|
from mercurial import cmdutil, commands
|
2008-01-25 19:28:21 +03:00
|
|
|
|
2011-05-12 22:27:35 +04:00
|
|
|
cmdtable = {}
|
|
|
|
command = cmdutil.command(cmdtable)
|
2012-05-15 23:37:49 +04:00
|
|
|
testedwith = 'internal'
|
2011-05-12 22:27:35 +04:00
|
|
|
|
|
|
|
@command('glog',
|
2012-04-14 12:44:13 +04:00
|
|
|
[('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')),
|
2011-05-12 22:27:35 +04:00
|
|
|
('r', 'rev', [], _('show the specified revision or range'), _('REV')),
|
2012-04-14 12:44:13 +04:00
|
|
|
('', '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')),
|
|
|
|
('', 'hidden', False, _('show hidden changesets (DEPRECATED)')),
|
|
|
|
] + commands.logopts + commands.walkopts,
|
|
|
|
_('[OPTION]... [FILE]'))
|
2011-04-23 17:04:15 +04:00
|
|
|
def graphlog(ui, repo, *pats, **opts):
|
2008-11-07 12:37:20 +03:00
|
|
|
"""show revision history alongside an ASCII revision graph
|
|
|
|
|
2009-07-26 03:46:28 +04:00
|
|
|
Print a revision history alongside a revision graph drawn with
|
|
|
|
ASCII characters.
|
2008-11-07 12:37:20 +03:00
|
|
|
|
2009-07-26 03:46:28 +04:00
|
|
|
Nodes printed as an @ character are parents of the working
|
|
|
|
directory.
|
2008-11-07 12:37:20 +03:00
|
|
|
"""
|
2012-07-14 21:09:22 +04:00
|
|
|
return cmdutil.graphlog(ui, repo, *pats, **opts)
|