[issue2973] Merging a named branch whose name collides with a changeset number merges the changeset at that number rather than the named branch
Domenic Santangelo
bugs at mercurial.selenic.com
Thu Aug 25 13:25:00 CDT 2011
New submission from Domenic Santangelo <domenics at gmail.com>:
I use a named branch per bug, and name those branches the number of the
ticket. Eg., ticket #314, hg branch 314.
If a branch's name (314) corresponds with a changeset's "short" number,
(314:6d36b944b50d) *AND* the named branch doesn't have an unmerged head,
merging the branch with the branch's name merges the *changeset* with that
number, not the branch.
In addition, hg up -C $branch results in an update to the revision instead
of the branch as well.
Example 1:
Assume I am creating a new branch "newbranch" off of default/tip. I want to
merge this new branch with named branch "314".
New branch: 328:2381f3dce1f9
Branch "314"'s last commit: ea01e45a3365
Changeset 314: 6d36b944b50d
$ hg branch newbranch
marked working directory as branch newbranch
$ hg merge 314
[...]
$ hg sum
parent: 328:2381f3dce1f9
parent: 314:6d36b944b50d
As you can see, the parents are 2381f3dce1f9 (expected), and 6d36b944b50d
(unexpected).
Example 2 (update works in the same way):
$ hg branch
default
$ hg up -C 314
[...]
$ hg sum
parent: 314:6d36b944b50d
--
For both of these, I would expect this to happen if I provided the "--rev"
param, but as you can see I did not.
Finally, I tried the --rev param in the following way:
$ hg merge --rev 'branch("314")'
and it behaved the same as example 1 above.
----------
messages: 17232
nosy: entendu
priority: bug
status: unread
title: Merging a named branch whose name collides with a changeset number merges the changeset at that number rather than the named branch
____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2973>
____________________________________________________
More information about the Mercurial-devel
mailing list