changeset 10015:b5f352f33520

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.
author Alexander Solovyov <piranha@piranha.org.ua>
date Sat, 28 Nov 2009 16:48:07 +0200
parents 54cd28258ea7
children 8a0af23af5d1
files mercurial/commands.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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":