Allow hg critic to accept a revset
authorGregory Szorc <gps@mozilla.com>
Fri, 08 Nov 2013 16:18:47 -0800
changeset 74 bc0e9c3a49362f318bd534f08295daeb0c503310
parent 73 e055c35a87ee7d03bd9236933f10e18b74cfb614
child 75 7157ce9546037b4e21d42f931d2b16974dd8ec23
push id54
push usergszorc@mozilla.com
push dateSat, 09 Nov 2013 00:18:50 +0000
Allow hg critic to accept a revset
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -285,16 +285,17 @@ from mercurial.node import (
 )
 from mercurial import (
     commands,
     cmdutil,
     demandimport,
     encoding,
     extensions,
     hg,
+    scmutil,
     util,
 )
 
 from mozautomation.changetracker import (
     ChangeTracker,
 )
 
 from mozautomation.commitparser import (
@@ -535,22 +536,23 @@ def tbpl(ui, repo, tree=None, rev=None, 
 @command('critic',
     [('e', 'entire', False,
         _('Report on entire file content, not just changed parts'),
         ''
     )],
     _('hg critic [REV]')
 )
 def critic(ui, repo, rev='.', entire=False, **opts):
-    """Perform a critique of a changeset.
+    """Perform a critique of changeset(s).
 
-    This will perform static analysis on a given changeset and report any
-    issues found.
+    This will perform static analysis on changeset(s) and report any issues
+    found.
     """
-    critique(ui, repo, node=rev, entire=entire, **opts)
+    for r in scmutil.revrange(repo, [rev]):
+        critique(ui, repo, node=r, entire=entire, **opts)
 
 
 @command('pushlogsync', [], _('hg pushlogsync'))
 def syncpushinfo(ui, repo, tree=None, **opts):
     """Synchronize the pushlog information for all known Gecko trees.
 
     The pushlog info contains who, when, and where individual changesets were
     pushed.