[PATCH 0 of 5] Various updates to make branches work better.

Eric Hopper hopper at omnifarious.org
Tue Jun 5 11:58:29 CDT 2007


These patches contain a number of related but distinct changes.

First, import is changed to add an option to allow branch information to
be imported.  It is already the case that import --exact will import
branch information.  But sometimes import and export are used for other
kinds of automated repository cleanups or changes.  In these cases it is
useful to be able to have the option of moving along branch information
without necessarily forcing the resulting revisions to have exactly
matching hashes.

An automated tool could parse the branch information out itself and set
the branch, but when Mercurial already has to have code to do this for
--exact to work right, why should an external tool have to duplicate
code?


Secondly, heads is given a new option that will tell you the heads for
the current branch.  These heads may or may not be also global
repository heads.  A branch head is simply defined as a revision in a
branch with no child revisions in that same branch.


Lastly, branches is made to not display 'inactive' branches by default.
An inactive branch is a branch for which there is no global repository
head.  A new option '-a' is created for branches to display a list of
all the branches in the repository.

I submit that this last change is absolutely necessary if branches are
to be seriously used.  A branch tag is an indelible part of a revision,
included in the revision's hash.  A shop that uses these kinds of tags
may have an arbitrarily large number of branches, most of which are
totally irrelevant to anything anybody might currently be doing.
Displaying only branches with active repository heads is a good
heuristic for which branches might be currently relevant.


The documentation provided for these commands calls global repository
heads 'active' heads.

The changes are based on the most recent version of crew, and they can
be pulled from either the attached bundle or from
http://hg.omnifarious.org/~hopper/merc-tocrew/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: branch-fix.hg
Type: application/octet-stream
Size: 4155 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20070605/d53a9299/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20070605/d53a9299/attachment.pgp 


More information about the Mercurial-devel mailing list