changeset 25304:9bc11716bc86

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.
author Matt Mackall <mpm@selenic.com>
date Wed, 27 May 2015 17:28:55 -0500
parents b7876b8fa063
children c87b05925054
files mercurial/commands.py tests/test-qrecord.t tests/test-record.t
diffstat 3 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri May 22 13:06:45 2015 -0700
+++ 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`,
--- a/tests/test-qrecord.t	Fri May 22 13:06:45 2015 -0700
+++ 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
--- a/tests/test-record.t	Fri May 22 13:06:45 2015 -0700
+++ 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