mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
9772d9af5a
issue2538 gives a case where a changeset is merged with its child (which is on another branch), and to my surprise the result is a real merge with two parents, not just a "fast forward" "merge" with only the child as parent. That is essentially the same as issue619. Is the existing behaviour as intended and correct? Or is the following fix correct? Some extra "created new head" pops up with this fix, but it seems to me like they could be considered correct. The old branch head has been superseeded by changes on the other branch, and when the changes on the other branch is merged back to the branch it will introduce a new head not directly related to the previous branch head. (I guess the intention with existing behaviour could be to ensure that the changesets on the branch are directly connected and that no new heads pops up on merges.)
35 lines
697 B
Perl
35 lines
697 B
Perl
http://mercurial.selenic.com/bts/issue619
|
|
|
|
$ hg init
|
|
$ echo a > a
|
|
$ hg ci -Ama
|
|
adding a
|
|
|
|
$ echo b > b
|
|
$ hg branch b
|
|
marked working directory as branch b
|
|
$ hg ci -Amb
|
|
adding b
|
|
|
|
$ hg co -C 0
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
Fast-forward:
|
|
|
|
$ hg merge b
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
(branch merge, don't forget to commit)
|
|
$ hg branch
|
|
default
|
|
$ hg parent --template '{rev}:{node|short} {branches}: {desc}\n'
|
|
1:06c2121185be b: b
|
|
$ hg ci -Ammerge
|
|
created new head
|
|
|
|
Bogus fast-forward should fail:
|
|
|
|
$ hg merge b
|
|
abort: merging with a working directory ancestor has no effect
|
|
[255]
|
|
|