[PATCH rfc] branches: introduce closing of other heads on other named branches

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Oct 25 08:55:35 CDT 2015



On 10/25/2015 03:45 AM, Matt Harbison wrote:
> On Sat, 24 Oct 2015 20:47:01 -0400, Didly <didlybom at gmail.com> wrote:
>
>> On Sun, Oct 25, 2015 at 2:02 AM, Mads Kiilerich <mads at kiilerich.com>
>> wrote:
>>> # HG changeset patch
>>> # User Mads Kiilerich <madski at unity3d.com>
>>> # Date 1445731342 -7200
>>> #      Sun Oct 25 02:02:22 2015 +0200
>>> # Branch stable
>>> # Node ID ee590daabd2fe53685f14289db72aa03faeb2cb1
>>> # Parent  39dbf495880b8a439d912091109427d27a7e616a
>>> branches: introduce closing of other heads on other named branches
>>>
>>> Closing of named branches was problematic. Especially when a lot of
>>> branches
>>> were used and there was a need for closing them so they no longer
>>> showed up.
>>> Closing a branch required a commit on the branch. That created an
>>> extra head on
>>> the branch. To make sure that users who had the changesets from the
>>> branch also
>>> had the close commit, the close had to be done before merging
>>> anywhere, or an
>>> additional merge had to be done. That became even more troublesome when
>>> branches were nested so merging one branch actually also introduced
>>> several
>>> other unclosed branch heads in the ancestry. The extra commits on
>>> branches
>>> could also often end up causing multiple heads on the branches if
>>> development
>>> was continued elsewhere anyway.
>>>
>>> Instead, make it possible for commits to also mark existing commits
>>> as closed.
>>> With --other-close REVSET, all the branch heads in that revset will
>>> be marked
>>> as closed in meta data of the commit.
>>>
>>> For general commits of closing all ancestor branch heads, use
>>> something like:
>>>   hg commit --other-close "::parents()"
>>>
>>> For more efficient closing of just the branches that has been merged,
>>> use
>>> something like:
>>>   hg commit --other-close "only(p2(),p1())"
>>
>> Since there is already a --close-branch flag, perhaps a better name
>> for this would be --close-branches ?
>
> That seems too subtly different from the original spelling wise.  Why
> not just let the existing --close-branch take a revset, and if none is
> given, '.' is implied?

We cannot use optional argument for --flag, because it is ambiguous with 
positional argument.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list