[PATCH 0 of 9] improvements for named branches

Matt Mackall mpm at selenic.com
Mon Mar 3 15:56:44 CST 2008


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".

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.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial-devel mailing list