diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t --- a/tests/test-merge-criss-cross.t +++ b/tests/test-merge-criss-cross.t @@ -444,3 +444,106 @@ getting d2/b 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (branch merge, don't forget to commit) + +Testing that whether a new filenode is created or not +----------------------------------------------------- + + $ cd ../ + $ hg init criss-cross-delete-revert + $ cd criss-cross-delete-revert + $ echo foo > foo + $ hg ci -Aqm 'added foo' + $ hg debugrevlogindex foo + rev linkrev nodeid p1 p2 + 0 0 2ed2a3912a0b 000000000000 000000000000 + $ hg rm foo + $ hg ci -m 'removed foo' + $ hg up '.^' + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ echo bar > bar + $ hg ci -Aqm 'added bar' + + $ hg log -G -T '{node|short} {desc}\n' + @ f63db81e6dde added bar + | + | o 1a0ab2bd5b5a removed foo + |/ + o f3ba8b99bb6f added foo + + + $ hg merge + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + (branch merge, don't forget to commit) + $ hg st + R foo + $ hg ci -m 'merged without foo' + $ hg log -G -T '{node|short} {desc}\n' + @ 411bc7ca43bc merged without foo + |\ + | o f63db81e6dde added bar + | | + o | 1a0ab2bd5b5a removed foo + |/ + o f3ba8b99bb6f added foo + + $ test -f foo + [1] + + $ hg co 1a0ab2bd5b5a + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg merge f63db81e6dde + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + $ hg revert foo --rev 'p2()' + $ hg st + M bar + M foo + $ hg ci -m 'merged with foo' + created new head + $ hg log -G -T '{node|short} {desc}\n' + @ 9c9dbcbc1e03 merged with foo + |\ + +---o 411bc7ca43bc merged without foo + | |/ + | o f63db81e6dde added bar + | | + o | 1a0ab2bd5b5a removed foo + |/ + o f3ba8b99bb6f added foo + + $ hg debugrevlogindex foo + rev linkrev nodeid p1 p2 + 0 0 2ed2a3912a0b 000000000000 000000000000 + + $ cat foo + foo + +Criss crossing merges now + + $ hg log -G -T '{node|short} {desc}\n' + @ 9c9dbcbc1e03 merged with foo + |\ + +---o 411bc7ca43bc merged without foo + | |/ + | o f63db81e6dde added bar + | | + o | 1a0ab2bd5b5a removed foo + |/ + o f3ba8b99bb6f added foo + +We should prompt instead of silently choosing a side here + $ hg merge 411bc7ca43bc + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + (branch merge, don't forget to commit) + $ ls + bar + +We should prompt instead of silently choosing a side here + $ hg co 411bc7ca43bc -C + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg merge 9c9dbcbc1e03 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + $ ls + bar + foo