amend: abort if both --patch and --extract are used stable
authorSushil khanchi <sushilkhanchi97@gmail.com>
Sun, 29 Sep 2019 11:47:18 +0530
branchstable
changeset 4988 588b3484c131
parent 4984 b779b40f996e
child 4989 25532ce787d9
amend: abort if both --patch and --extract are used
CHANGELOG
hgext3rd/evolve/cmdrewrite.py
tests/test-amend.t
--- 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
 -------------------
--- 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'):
--- 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]