commands.export: accept -r option as revision specification
authorAlexander Solovyov <piranha@piranha.org.ua>
Sat, 28 Nov 2009 16:48:07 +0200
changeset 10015 b5f352f33520
parent 10014 54cd28258ea7
child 10016 8a0af23af5d1
commands.export: accept -r option as revision specification This brings consistency with other commands option and allows specification of negative numbers (-r -2), which were recognized as options earlier.
mercurial/commands.py
--- a/mercurial/commands.py	Mon Nov 30 23:51:06 2009 +0100
+++ b/mercurial/commands.py	Sat Nov 28 16:48:07 2009 +0200
@@ -1161,6 +1161,7 @@
     With the --switch-parent option, the diff will be against the
     second parent. It can be useful to review a merge.
     """
+    changesets += tuple(opts.get('rev', []))
     if not changesets:
         raise util.Abort(_("export requires at least one changeset"))
     revs = cmdutil.revrange(repo, changesets)
@@ -3456,7 +3457,8 @@
     "^export":
         (export,
          [('o', 'output', '', _('print output to file with formatted name')),
-          ('', 'switch-parent', None, _('diff against the second parent'))
+          ('', 'switch-parent', None, _('diff against the second parent')),
+          ('r', 'rev', [], _('revisions to export')),
           ] + diffopts,
          _('[OPTION]... [-o OUTFILESPEC] REV...')),
     "^forget":