Mercurial > public > mercurial-scm > hg-stable
diff hgext/rebase.py @ 43936: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 |
line wrap: on
line diff
--- a/hgext/rebase.py Thu Dec 12 22:43:15 2019 -0800 +++ b/hgext/rebase.py Thu Dec 12 23:03:52 2019 -0800 @@ -1034,11 +1034,11 @@ inmemory = False if opts.get(b'auto_orphans'): - for key in opts: - if key != b'auto_orphans' and opts.get(key): - raise error.Abort( - _(b'--auto-orphans is incompatible with %s') % (b'--' + key) - ) + disallowed_opts = set(opts) - {b'auto_orphans'} + cmdutil.check_incompatible_arguments( + opts, b'auto_orphans', *disallowed_opts + ) + userrevs = list(repo.revs(opts.get(b'auto_orphans'))) opts[b'rev'] = [revsetlang.formatspec(b'%ld and orphan()', userrevs)] opts[b'dest'] = b'_destautoorphanrebase(SRC)'