# HG changeset patch # User Matt Mackall # Date 1186079033 18000 # Node ID 2ef14e29e538a9ae1a89221b63d21b6d61331d50 # Parent 99a4592ea8860dd92cc81b1449af8ef1666410bc# Parent 8d9bdcbb2b1852d2507cbb7e5d922f549f73f19d Merge with -stable diff -r 99a4592ea886 -r 2ef14e29e538 mercurial/merge.py --- a/mercurial/merge.py Thu Aug 02 14:51:49 2007 +0200 +++ b/mercurial/merge.py Thu Aug 02 13:23:53 2007 -0500 @@ -415,10 +415,10 @@ updated += 1 else: merged += 1 - if f != fd and move: + util.set_exec(repo.wjoin(fd), "x" in flags) + if f != fd and move and util.lexists(repo.wjoin(f)): 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] repo.ui.note(_("getting %s\n") % f) diff -r 99a4592ea886 -r 2ef14e29e538 tests/test-copy-move-merge --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-copy-move-merge Thu Aug 02 13:23:53 2007 -0500 @@ -0,0 +1,30 @@ +#!/bin/sh + +mkdir t +cd t +hg init + +echo 1 > a +hg ci -qAm "first" -d "1000000 0" + +hg cp a b +hg mv a c +echo 2 >> b +echo 2 >> c + +hg ci -qAm "second" -d "1000000 0" + +hg co -C 0 + +echo 0 > a +echo 1 >> a + +hg ci -qAm "other" -d "1000000 0" + +hg merge --debug + +echo "-- b --" +cat b + +echo "-- c --" +cat c diff -r 99a4592ea886 -r 2ef14e29e538 tests/test-copy-move-merge.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-copy-move-merge.out Thu Aug 02 13:23:53 2007 -0500 @@ -0,0 +1,23 @@ +1 files updated, 0 files merged, 2 files removed, 0 files unresolved +resolving manifests + overwrite None partial False + ancestor 583c7b748052 local fb3948d97f07+ remote 40da226db0f0 + a: remote moved to c -> m + a: remote moved to b -> m +copying a to b +copying a to c +merging a and b +my a@fb3948d97f07+ other b@40da226db0f0 ancestor a@583c7b748052 +removing a +merging a and c +my a@fb3948d97f07+ other c@40da226db0f0 ancestor a@583c7b748052 +0 files updated, 2 files merged, 0 files removed, 0 files unresolved +(branch merge, don't forget to commit) +-- b -- +0 +1 +2 +-- c -- +0 +1 +2