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

Alexander Solovyov piranha at piranha.org.ua
Tue Jun 1 13:10:41 CDT 2010


# HG changeset patch
# User Alexander Solovyov <piranha at piranha.org.ua>
# Date 1274989823 -10800
# Node ID d5bcc283dfcd1ece9446b06590eab6a150b2d7e5
# Parent  c61442f6d106ae2b91672898715e0fee26eeb54d
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
 
@@ -183,6 +183,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]")),
 }
diff --git a/tests/test-churn b/tests/test-churn
--- a/tests/test-churn
+++ b/tests/test-churn
@@ -30,6 +30,8 @@ cd d
 hg churn e
 echo % churn all
 hg churn
+echo % churn excluding one dir
+hg churn -X e
 echo % churn up to rev 2
 hg churn -r :2
 cd ..
diff --git a/tests/test-churn.out b/tests/test-churn.out
--- a/tests/test-churn.out
+++ b/tests/test-churn.out
@@ -8,6 +8,10 @@ user1      1 ***************************
 user3      3 ***************************************************************
 user1      3 ***************************************************************
 user2      2 ******************************************
+% churn excluding one dir
+user3      3 ***************************************************************
+user2      2 ******************************************
+user1      2 ******************************************
 % churn up to rev 2
 user2      2 ***************************************************************
 user1      1 ********************************


More information about the Mercurial-devel mailing list