[PATCH 0 of 9] improvements for named branches

Adrian Buehlmann adrian at cadifra.com
Tue Mar 4 03:28:50 CST 2008


On 03.03.2008 22:56, Matt Mackall wrote:
> On Mon, Mar 03, 2008 at 09:31:29PM +0100, Peter Arrenbrecht wrote:
>> On Mon, Mar 3, 2008 at 6:04 PM, Jesse Glick <jesse.glick at sun.com> wrote:
>>> Matt Mackall wrote:
>>>  > How do you unclose a branch?
>>>
>>>  Possible alternative: consider a head to be closed iff it contains a
>>>  file '.hgclosed' in the root dir (contents irrelevant, could be empty or
>>>  contain an explanatory message). Simple to close or unclose a branch
>>>  using hg add/rem, no extra metadata field needed, change takes effect
>>>  with the commit. A branch would be closed if all its heads were closed.
>> Interesting idea. But wouldn't this slow the `hg branches` command
>> down quite a bit if there are lots of (open or closed) heads? It seems
>> to me hg would have to retrieve the manifest for each head.
> 
> Well that's what the cache is for. But building the cache will become
> more expensive, yes. My back-of-the-napkin design uses an extra field
> in the changeset to say "this branch head is closed".

+1
for the extra field in the changeset to say "this head is closed".

Presuming that Mercurial would then allow committing a changeset
that does nothing but changing this field (i.e. not contain any
modifications to tracked files).

This feature would be great to have because it would eliminate the need
for the artificial "pruning dead branches" merge as described on
http://www.selenic.com/mercurial/wiki/index.cgi/TipsAndTricks

> Again, doing this all at commit time rather than storing some
> additional state (like a new special file) before commit avoids a bunch of
> complexity anyway.

Indeed.





More information about the Mercurial-devel mailing list