[PATCH] commit: improve --close-branch documentation

Matt Mackall mpm at selenic.com
Wed May 27 17:32:59 CDT 2015


# HG changeset patch
# User Matt Mackall <mpm at selenic.com>
# Date 1432765735 18000
#      Wed May 27 17:28:55 2015 -0500
# Node ID ad4fe07cfdcd2a1967a3380fef4237313b717380
# Parent  9f5e89c999e71d8a2a6ca6c6ccbac2d6ff62bac5
commit: improve --close-branch documentation

The confusion about whether this flag closes a whole branch or just a
head comes up regularly on IRC, so add some clarification.

diff -r 9f5e89c999e7 -r ad4fe07cfdcd mercurial/commands.py
--- a/mercurial/commands.py	Wed May 27 13:28:16 2015 -0400
+++ b/mercurial/commands.py	Wed May 27 17:28:55 2015 -0500
@@ -1080,7 +1080,9 @@
     change.
 
     Use the command :hg:`update` to switch to an existing branch. Use
-    :hg:`commit --close-branch` to mark this branch as closed.
+    :hg:`commit --close-branch` to mark this branch head as closed.
+    When all heads of the branch are closed, the branch will be
+    considered closed.
 
     Returns 0 on success.
     """
@@ -1418,7 +1420,7 @@
     [('A', 'addremove', None,
      _('mark new/missing files as added/removed before committing')),
     ('', 'close-branch', None,
-     _('mark a branch as closed, hiding it from the branch list')),
+     _('mark a branch head as closed')),
     ('', 'amend', None, _('amend the parent of the working directory')),
     ('s', 'secret', None, _('use the secret phase for committing')),
     ('e', 'edit', None, _('invoke editor on commit messages')),
@@ -1444,6 +1446,10 @@
     commit fails, you will find a backup of your message in
     ``.hg/last-message.txt``.
 
+    The --close-branch flag can be used to mark the current branch
+    head closed. When all heads of a branch are closed, the branch
+    will be considered closed and no longer listed.
+
     The --amend flag can be used to amend the parent of the
     working directory with a new commit that contains the changes
     in the parent in addition to those currently reported by :hg:`status`,
diff -r 9f5e89c999e7 -r ad4fe07cfdcd tests/test-qrecord.t
--- a/tests/test-qrecord.t	Wed May 27 13:28:16 2015 -0400
+++ b/tests/test-qrecord.t	Wed May 27 17:28:55 2015 -0500
@@ -58,8 +58,7 @@
   
    -A --addremove           mark new/missing files as added/removed before
                             committing
-      --close-branch        mark a branch as closed, hiding it from the branch
-                            list
+      --close-branch        mark a branch head as closed
       --amend               amend the parent of the working directory
    -s --secret              use the secret phase for committing
    -e --edit                invoke editor on commit messages
diff -r 9f5e89c999e7 -r ad4fe07cfdcd tests/test-record.t
--- a/tests/test-record.t	Wed May 27 13:28:16 2015 -0400
+++ b/tests/test-record.t	Wed May 27 17:28:55 2015 -0500
@@ -45,8 +45,7 @@
   
    -A --addremove           mark new/missing files as added/removed before
                             committing
-      --close-branch        mark a branch as closed, hiding it from the branch
-                            list
+      --close-branch        mark a branch head as closed
       --amend               amend the parent of the working directory
    -s --secret              use the secret phase for committing
    -e --edit                invoke editor on commit messages


More information about the Mercurial-devel mailing list