Mercurial > hg
comparison hgext/rebase.py @ 43930:412f199b4092
rebase: use cmdutil.check_incompatible_arguments() for --auto-orphans
Differential Revision: https://phab.mercurial-scm.org/D7644
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 12 Dec 2019 23:03:52 -0800 |
parents | 08b8bf4a8516 |
children | 8c87cc169946 |
comparison
equal
deleted
inserted
replaced
43929:08b8bf4a8516 | 43930:412f199b4092 |
---|---|
1032 # (Or if it is run within a transaction, since the restart logic can | 1032 # (Or if it is run within a transaction, since the restart logic can |
1033 # fail the entire transaction.) | 1033 # fail the entire transaction.) |
1034 inmemory = False | 1034 inmemory = False |
1035 | 1035 |
1036 if opts.get(b'auto_orphans'): | 1036 if opts.get(b'auto_orphans'): |
1037 for key in opts: | 1037 disallowed_opts = set(opts) - {b'auto_orphans'} |
1038 if key != b'auto_orphans' and opts.get(key): | 1038 cmdutil.check_incompatible_arguments( |
1039 raise error.Abort( | 1039 opts, b'auto_orphans', *disallowed_opts |
1040 _(b'--auto-orphans is incompatible with %s') % (b'--' + key) | 1040 ) |
1041 ) | 1041 |
1042 userrevs = list(repo.revs(opts.get(b'auto_orphans'))) | 1042 userrevs = list(repo.revs(opts.get(b'auto_orphans'))) |
1043 opts[b'rev'] = [revsetlang.formatspec(b'%ld and orphan()', userrevs)] | 1043 opts[b'rev'] = [revsetlang.formatspec(b'%ld and orphan()', userrevs)] |
1044 opts[b'dest'] = b'_destautoorphanrebase(SRC)' | 1044 opts[b'dest'] = b'_destautoorphanrebase(SRC)' |
1045 | 1045 |
1046 if opts.get(b'dry_run') or opts.get(b'confirm'): | 1046 if opts.get(b'dry_run') or opts.get(b'confirm'): |