hg heads -a showing closed branch
Matt Mackall
mpm at selenic.com
Wed Jul 8 11:23:02 CDT 2009
On Wed, 2009-07-08 at 22:52 +1000, Peter Mayne wrote:
> If I create a branch in my repository (version 1.3 on Windows), then
> close that branch using "hg ci --close-branch", I get the following:
>
> C:\tmp\repob>hg branches
> default 4:1f2fa654ab3d
>
> C:\tmp\repob>hg branches -c
> default 4:1f2fa654ab3d
> br1 3:8160933f9b56 (closed)
>
> C:\tmp\repob>hg heads -a
> changeset: 4:1f2fa654ab3d
> tag: tip
> parent: 2:664e7c45059a
> user: PJDM <Peter.Mayne at localhost>
> date: Wed Jul 08 22:46:27 2009 +1000
> summary: five
>
> changeset: 3:8160933f9b56
> branch: br1
> parent: 1:7d20e8592890
> user: PJDM <Peter.Mayne at localhost>
> date: Wed Jul 08 22:43:13 2009 +1000
> summary: close br1
>
> Shouldn't "hg heads -a" only show the active head (default), and not the
> head from the closed branch (br1)? If so, wouldn't -a be a good default
> for "hg heads", as it appears to be for "hg branches"?
heads -a or heads -c without a branch name should actually raise an
error. There are two different concepts:
heads: all changesets with no descendants (hg heads)
branch heads: all changesets in a branch with no descendants in that
branch (hg heads <branch>)
Active and closed are only intended to apply to the latter. In fact
heads -a is redundant: active heads are the branch heads that are also
heads. We could make heads -a and -c 'work', but I fear that would just
encourage the existing confusion between the two head concepts.
--
http://selenic.com : development and support for Mercurial and Linux
More information about the Mercurial
mailing list