changeset 42934:09d46b90f6f9

amend: enable support for closing the branch This comes from the evolve extension's version of amend. The logic was already in place. Differential Revision: https://phab.mercurial-scm.org/D6855
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 14 Sep 2019 23:40:12 -0400
parents 7e9997041781
children f10a0f5eedae
files hgext/amend.py relnotes/next tests/test-amend.t
diffstat 3 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/amend.py	Sat Sep 14 18:44:18 2019 -0400
+++ b/hgext/amend.py	Sat Sep 14 23:40:12 2019 -0400
@@ -34,6 +34,8 @@
       _('mark new/missing files as added/removed before committing')),
      ('e', 'edit', None, _('invoke editor on commit messages')),
      ('i', 'interactive', None, _('use interactive mode')),
+     (b'', b'close-branch', None,
+      _(b'mark a branch as closed, hiding it from the branch list')),
      ('n', 'note', '', _('store a note on the amend')),
     ] + cmdutil.walkopts + cmdutil.commitopts + cmdutil.commitopts2
       + cmdutil.commitopts3,
--- a/relnotes/next	Sat Sep 14 18:44:18 2019 -0400
+++ b/relnotes/next	Sat Sep 14 23:40:12 2019 -0400
@@ -2,6 +2,8 @@
 
  * The amend extension supports the `--currentuser` argument.
 
+ * The amend extension supports the `--close-branch` argument.
+
  * The uncommit extension supports the `rewrite.update-timestamp` config option.
 
 == New Experimental Features ==
--- a/tests/test-amend.t	Sat Sep 14 18:44:18 2019 -0400
+++ b/tests/test-amend.t	Sat Sep 14 23:40:12 2019 -0400
@@ -450,6 +450,12 @@
   abort: --date and --currentdate are mutually exclusive
   [255]
 
+Close branch
+
+  $ hg amend --close-branch
+  $ hg log --limit 1 -T 'close={get(extras, "close")}\n'
+  close=1
+
   $ cd ..
 
 Corner case of amend from issue6157: