--- a/mercurial/merge.py Fri Jun 22 17:29:49 2007 -0500
+++ b/mercurial/merge.py Sat Jun 23 12:05:00 2007 +0200
@@ -401,12 +401,12 @@
updated += 1
else:
merged += 1
- if f != fd:
- repo.ui.debug(_("copying %s to %s\n") % (f, fd))
- repo.wwrite(fd, repo.wread(f), flags)
- if move:
- repo.ui.debug(_("removing %s\n") % f)
- os.unlink(repo.wjoin(f))
+ if f != fd:
+ repo.ui.debug(_("copying %s to %s\n") % (f, fd))
+ repo.wwrite(fd, repo.wread(f), flags)
+ if move:
+ repo.ui.debug(_("removing %s\n") % f)
+ os.unlink(repo.wjoin(f))
util.set_exec(repo.wjoin(fd), "x" in flags)
elif m == "g": # get
flags = a[2]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge9 Sat Jun 23 12:05:00 2007 +0200
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# test that we don't interrupt the merge session if
+# a file-level merge failed
+
+hg init repo
+cd repo
+
+echo foo > foo
+echo a > bar
+hg ci -Am 'add foo' -d '0 0'
+
+hg mv foo baz
+echo b >> bar
+echo quux > quux1
+hg ci -Am 'mv foo baz' -d '0 0'
+
+hg up -qC 0
+echo >> foo
+echo c >> bar
+echo quux > quux2
+hg ci -Am 'change foo' -d '0 0'
+
+# test with the rename on the remote side
+HGMERGE=false hg merge
+
+# test with the rename on the local side
+hg up -C 1
+HGMERGE=false hg merge
+
+true
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge9.out Sat Jun 23 12:05:00 2007 +0200
@@ -0,0 +1,21 @@
+adding bar
+adding foo
+adding quux1
+adding quux2
+merging bar
+merging bar failed!
+merging foo and baz
+merging foo failed!
+1 files updated, 0 files merged, 0 files removed, 2 files unresolved
+There are unresolved merges, you can redo the full merge using:
+ hg update -C 2
+ hg merge 1
+3 files updated, 0 files merged, 1 files removed, 0 files unresolved
+merging bar
+merging bar failed!
+merging baz and foo
+merging baz failed!
+1 files updated, 0 files merged, 0 files removed, 2 files unresolved
+There are unresolved merges, you can redo the full merge using:
+ hg update -C 1
+ hg merge 2