Improving on branch closing

Dirkjan Ochtman dirkjan at ochtman.nl
Sun Jul 19 06:33:47 CDT 2009


So in converting the Python repository (which has a bunch of named
branches, many of which have been deleted), I've run into something
stupid that comes with the way we do branch closing (namely, putting
'close': 1 in the extra closes the branch head for the branch that
that extra belongs to): by default, it leaves the closing branchhead
as a head in the changelog graph. This sucks because Mercurial has a
bunch of corners with an O(heads) factor in them. Another oddity is
that activeness (having unmerged branchheads) and closedness are
completely separate notions.

The solution would be to close the branch, then merge it the closing
branchhead into some other (active/non-closed) branch. This seems like
something of a kludge, though, because you need an extra changeset to
do it (although it doesn't come with an extra addition to manifest or
any of the filelogs).

So, I was wondering, wouldn't it be better to allow branchhead closing
only in merge changesets? This would be as functional as the current
solution, without requiring the extra changeset and automatically
eliminating the extra head. Compatibility with the old solution
shouldn't be too hard, I think (and at this point there aren't that
many people using that, anyway, I think). We only need a way to set
something in extra that clarifies which of the parent branches to
close. I guess that could just be implicit, e.g., close the parent
branch that is not the changeset branch. We could also put it in the
close value in extra, which would help to distinguish it from the old
closing mechanism.

Is this silly, or would it actually be worthwhile?

Cheers,

Dirkjan


More information about the Mercurial-devel mailing list