[PATCH] churn: add possibility to include/exclude paths

Alexander Solovyov piranha at piranha.org.ua
Thu May 27 14:50:42 CDT 2010


# HG changeset patch
# User Alexander Solovyov <piranha at piranha.org.ua>
# Date 1274989823 -10800
# Node ID a90abc6b62dd9f621c6c5694a22bae5965f7e253
# Parent  ab6d206db4832191c9d6794b4165c3f28a83bd21
churn: add possibility to include/exclude paths

diff --git a/hgext/churn.py b/hgext/churn.py
--- a/hgext/churn.py
+++ b/hgext/churn.py
@@ -9,7 +9,7 @@
 '''command to display statistics about repository history'''
 
 from mercurial.i18n import _
-from mercurial import patch, cmdutil, util, templater
+from mercurial import patch, cmdutil, util, templater, commands
 import os
 import time, datetime
 
@@ -151,12 +151,11 @@ def churn(ui, repo, *pats, **opts):
     if opts.get('diffstat'):
         width -= 15
         def format(name, (added, removed)):
-            return "%s %15s %s%s\n" % (pad(name, maxname),
-                                       '+%d/-%d' % (added, removed),
-                                       ui.label('+' * charnum(added),
-                                                'diffstat.inserted'),
-                                       ui.label('-' * charnum(removed),
-                                                'diffstat.deleted'))
+            return "%s %15s %s%s\n" % (
+                pad(name, maxname),
+                '+%d/-%d' % (added, removed),
+                ui.label('+' * charnum(added), 'diffstat.inserted'),
+                ui.label('-' * charnum(removed), 'diffstat.deleted'))
     else:
         width -= 6
         def format(name, count):
@@ -183,6 +182,6 @@ cmdtable = {
           ('s', 'sort', False, _('sort by key (default: sort by count)')),
           ('', 'diffstat', False, _('display added/removed lines separately')),
           ('', 'aliases', '', _('file with email aliases')),
-          ],
+          ] + commands.walkopts,
          _("hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]")),
 }


More information about the Mercurial-devel mailing list