Patchwork [27,of,35] churn: define inferrepo in command decorator

mail settings
Submitter Gregory Szorc
Date May 5, 2014, 5:51 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/4618/
State Accepted
Commit a57deb45c744d982d0ab2e115347168eb6830228
Headers show


Gregory Szorc - May 5, 2014, 5:51 a.m.
# HG changeset patch
# User Gregory Szorc <>
# 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/ b/hgext/
--- a/hgext/
+++ b/hgext/
@@ -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"