Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 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 | 0022f5c5459e |
comparison
equal
deleted
inserted
replaced
10014:54cd28258ea7 | 10015:b5f352f33520 |
---|---|
1159 format. See 'hg help diffs' for more information. | 1159 format. See 'hg help diffs' for more information. |
1160 | 1160 |
1161 With the --switch-parent option, the diff will be against the | 1161 With the --switch-parent option, the diff will be against the |
1162 second parent. It can be useful to review a merge. | 1162 second parent. It can be useful to review a merge. |
1163 """ | 1163 """ |
1164 changesets += tuple(opts.get('rev', [])) | |
1164 if not changesets: | 1165 if not changesets: |
1165 raise util.Abort(_("export requires at least one changeset")) | 1166 raise util.Abort(_("export requires at least one changeset")) |
1166 revs = cmdutil.revrange(repo, changesets) | 1167 revs = cmdutil.revrange(repo, changesets) |
1167 if len(revs) > 1: | 1168 if len(revs) > 1: |
1168 ui.note(_('exporting patches:\n')) | 1169 ui.note(_('exporting patches:\n')) |
3454 ] + diffopts + diffopts2 + walkopts, | 3455 ] + diffopts + diffopts2 + walkopts, |
3455 _('[OPTION]... [-r REV1 [-r REV2]] [FILE]...')), | 3456 _('[OPTION]... [-r REV1 [-r REV2]] [FILE]...')), |
3456 "^export": | 3457 "^export": |
3457 (export, | 3458 (export, |
3458 [('o', 'output', '', _('print output to file with formatted name')), | 3459 [('o', 'output', '', _('print output to file with formatted name')), |
3459 ('', 'switch-parent', None, _('diff against the second parent')) | 3460 ('', 'switch-parent', None, _('diff against the second parent')), |
3461 ('r', 'rev', [], _('revisions to export')), | |
3460 ] + diffopts, | 3462 ] + diffopts, |
3461 _('[OPTION]... [-o OUTFILESPEC] REV...')), | 3463 _('[OPTION]... [-o OUTFILESPEC] REV...')), |
3462 "^forget": | 3464 "^forget": |
3463 (forget, | 3465 (forget, |
3464 [] + walkopts, | 3466 [] + walkopts, |