Something fishy with branch head
Greg Ward
greg at gerg.ca
Thu Aug 27 20:06:44 UTC 2009
I'm trying some basic workflow operations on a trial conversion from a
fairly large CVS repo (108,000 changesets, 169 branches, 17,000)
files). Right now I'm trying to ensure that all recent release
branches are merged up to the trunk: i.e. release i merged to release
i+1 merged to release i+2 ... merged to trunk (aka default).
But I'm getting confused by some very basic stuff, and I hope I'm not
seeing a bug.
First, here's the actual sequence of branches that I want to merge:
PACS-3-7-1
PACS-3-7-2
PACS-3-8-1
PACS-3-8-2
default
So my first step is to merge PACS-3-7-1 to PACS-3-7-2. 'hg branches'
claims this branch is active, i.e. has a head:
$ /usr/local/hg-1.3/hg branches -a | head
default 108707:11b2726ebb69
PACS-3-8-2 108702:7fff910c0944
PACS-3-7-2 108691:1c4d4b7de4ba
PACS-3-8-1 108682:cf76faa059c4
PACS-3-7-1 108665:a860d470aa81
[...many more branches...]
But that's not right: there exists a merge changeset on another branch
whose second parent is 108665:
$ hg glog --template "{rev}:{node|short} {branches}\n"
[...]
| o | | | 108667:70d522ddc703 PACS-3-8-1-GA
| |\| | |
| | o | | 108666:05338dc3c58e PACS-3-7-2
| | |\ \ \
| | | o | | 108665:a860d470aa81 PACS-3-7-1
| | | | | |
| +-----o | 108664:6d7eedb13051 PACS-3-8-2
[...]
That is, 108665 is a branch head (it has no children on branch
PACS-3-7-1), but it is not a repo head (it does have children on other
branches). Alternate (non-graphical) proof:
$ hg log -r108666 --template "{rev}:{node|short} {branches}\n"
108666:05338dc3c58e PACS-3-7-2
$ hg parents -r108666 --template "{rev}:{node|short} {branches}\n"
108658:6b9a8f6326de PACS-3-7-2
108665:a860d470aa81 PACS-3-7-1
Or, another way:
$ hg heads -q | grep 108665
[no output: 108665 is *not* a head]
So, is 'hg branches' wrong about PACS-3-7-1 being an "active" branch?
Or am I misunderstanding things?
Incidentally, I'm seeing the same result with Mercurial 1.1.1, 1.2.1,
and 1.3.1. I also get the same result if I delete
.hg/branchheads.cache and re-run 'hg branches'.
Anyways, this confusion leads to other confusion. For example,
'merge' and 'merge --preview' behave differently:
$ /usr/local/hg-1.3/hg update PACS-3-7-2
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ /usr/local/hg-1.3/hg merge --preview PACS-3-7-1
changeset: 108665:a860d470aa81
branch: PACS-3-7-1
parent: 108657:3b8cad0071af
[...]
but
$ /usr/local/hg-1.3/hg merge PACS-3-7-1
abort: can't merge with ancestor
>From looking at the graph, it appears that 'merge' is right, 'merge
--preview' is wrong, 'heads' is right, and 'branches' is wrong. Aiee!
Any clue what's going on? Thanks --
Greg
More information about the Mercurial
mailing list