# HG changeset patch # User Sushil khanchi # Date 1569737838 -19800 # Node ID 588b3484c131f83f6624b232216d2d1c549c6e32 # Parent b779b40f996eb94f036460686ca26cec51f6e76b amend: abort if both --patch and --extract are used diff -r b779b40f996e -r 588b3484c131 CHANGELOG --- a/CHANGELOG Fri Dec 06 14:01:29 2019 +0100 +++ b/CHANGELOG Sun Sep 29 11:47:18 2019 +0530 @@ -13,6 +13,7 @@ * topic: add more options to command synopsis string * evolve: use more often seen metavariables in command synopsis strings * documentation: update text and add missing figures + * amend: cleany abort when both `--patch` and `--extract` are passed 9.2.1 -- 2019-10-05 ------------------- diff -r b779b40f996e -r 588b3484c131 hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Fri Dec 06 14:01:29 2019 +0100 +++ b/hgext3rd/evolve/cmdrewrite.py Sun Sep 29 11:47:18 2019 +0530 @@ -128,6 +128,8 @@ """ _checknotesize(ui, opts) opts = opts.copy() + if opts.get('patch') and opts.get('extract'): + raise error.Abort(_(b'cannot use both --patch and --extract')) if opts.get('patch'): return amendpatch(ui, repo, *pats, **opts) if opts.get('extract'): diff -r b779b40f996e -r 588b3484c131 tests/test-amend.t --- a/tests/test-amend.t Fri Dec 06 14:01:29 2019 +0100 +++ b/tests/test-amend.t Sun Sep 29 11:47:18 2019 +0530 @@ -165,3 +165,8 @@ -i --interactive use interactive mode (some details hidden, use --verbose to show complete help) + +Check that we abort if --patch and --extract both are used at once + $ hg amend --patch --extract + abort: cannot use both --patch and --extract + [255]