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.
--- 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":