[PATCH 27 of 35] churn: define inferrepo in command decorator
Gregory Szorc
gregory.szorc at gmail.com
Mon May 5 05:51:32 UTC 2014
# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1399267478 25200
# Sun May 04 22:24:38 2014 -0700
# Branch stable
# Node ID 026a998061da9f149cf080592533bef9d2a5b911
# Parent 0346a21b64c1354b4058ae1ee408a5cc513de670
churn: define inferrepo in command decorator
diff --git a/hgext/churn.py b/hgext/churn.py
--- a/hgext/churn.py
+++ b/hgext/churn.py
@@ -99,17 +99,18 @@ def countrate(ui, repo, amap, *pats, **o
_('template to group changesets'), _('TEMPLATE')),
('f', 'dateformat', '',
_('strftime-compatible format for grouping by date'), _('FORMAT')),
('c', 'changesets', False, _('count rate by number of changesets')),
('s', 'sort', False, _('sort by key (default: sort by count)')),
('', 'diffstat', False, _('display added/removed lines separately')),
('', 'aliases', '', _('file with email aliases'), _('FILE')),
] + commands.walkopts,
- _("hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]"))
+ _("hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]"),
+ inferrepo=True)
def churn(ui, repo, *pats, **opts):
'''histogram of changes to the repository
This command will display a histogram representing the number
of changed lines or revisions, grouped according to the given
template. The default template will group changes by author.
The --dateformat option may be used to group the results by
date instead.
@@ -192,10 +193,8 @@ def churn(ui, repo, *pats, **opts):
return "%s %6d %s\n" % (pad(name, maxname), sum(count),
'*' * charnum(sum(count)))
def charnum(count):
return int(round(count * width / maxcount))
for name, count in rate:
ui.write(format(name, count))
-
-commands.inferrepo += " churn"
More information about the Mercurial-devel
mailing list