mq.strip: allow -r option, optionally
authorJordi Gutiérrez Hermoso <jordigh@octave.org>
Tue, 20 Sep 2011 15:02:00 -0500
changeset 15148 510184e5a09e
parent 15147 395ca8cd2669
child 15149 eaec9cf91aea
mq.strip: allow -r option, optionally Other commands let -r to be used for revisions, so just for syntactic consistency, it's nice to have it for strip as well
hgext/mq.py
--- a/hgext/mq.py	Tue Sep 20 20:21:04 2011 +0200
+++ b/hgext/mq.py	Tue Sep 20 15:02:00 2011 -0500
@@ -2677,7 +2677,11 @@
     return 0
 
 @command("strip",
-         [('f', 'force', None, _('force removal of changesets, discard '
+         [
+          ('r', 'rev', [], _('strip specified revision (optional, '
+                               'can specify revisions without this '
+                               'option)'), _('REV')),
+          ('f', 'force', None, _('force removal of changesets, discard '
                                  'uncommitted changes (no backup)')),
           ('b', 'backup', None, _('bundle only changesets with local revision'
                                   ' number greater than REV which are not'
@@ -2718,6 +2722,7 @@
         backup = 'none'
 
     cl = repo.changelog
+    revs = list(revs) + opts.get('rev')
     revs = set(scmutil.revrange(repo, revs))
     if not revs:
         raise util.Abort(_('empty revision set'))