# HG changeset patch # User Matt Mackall # Date 2015-05-27 22:28:55 # Node ID 9bc11716bc86c425a9518e0ed4eea6d9269140d3 # Parent b7876b8fa063352e4eb835cee60d8555cbb42adb 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 --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1080,7 +1080,9 @@ def branch(ui, repo, label=None, **opts) 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 @@ def clone(ui, source, dest=None, **opts) [('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 @@ def commit(ui, repo, *pats, **opts): 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 --git a/tests/test-qrecord.t b/tests/test-qrecord.t --- a/tests/test-qrecord.t +++ b/tests/test-qrecord.t @@ -58,8 +58,7 @@ help record (record) -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 --git a/tests/test-record.t b/tests/test-record.t --- a/tests/test-record.t +++ b/tests/test-record.t @@ -45,8 +45,7 @@ Record help -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