# HG changeset patch # User Matt Mackall # Date 1160459640 18000 # Node ID e8be5942335d5985ed6e86e07a8f82868273b424 # Parent ecc1bf27378c1221755fe25ec412290ad57198dd merge: pull file copy/move out of filemerge diff -r ecc1bf27378c -r e8be5942335d mercurial/merge.py --- a/mercurial/merge.py Tue Oct 10 00:41:55 2006 -0500 +++ b/mercurial/merge.py Tue Oct 10 00:54:00 2006 -0500 @@ -10,14 +10,12 @@ from demandload import * demandload(globals(), "errno util os tempfile") -def filemerge(repo, fw, fo, fd, wctx, mctx, move): +def filemerge(repo, fw, fo, wctx, mctx): """perform a 3-way merge in the working directory fw = filename in the working directory and first parent fo = filename in other parent - fd = destination filename wctx, mctx = working and merge changecontexts - move = whether to move or copy the file to the destination TODO: if fw is copied in the working directory, we get confused @@ -52,13 +50,6 @@ 'HG_OTHER_NODE': str(mctx)}) if r: repo.ui.warn(_("merging %s failed!\n") % fw) - else: - if fd != fw: - repo.ui.debug(_("copying %s to %s\n") % (fw, fd)) - repo.wwrite(fd, repo.wread(fw)) - if move: - repo.ui.debug(_("removing %s\n") % fw) - os.unlink(a) os.unlink(b) os.unlink(c) @@ -294,8 +285,16 @@ repo.ui.status(_("merging %s and %s to %s\n") % (f, f2, fd)) else: repo.ui.status(_("merging %s\n") % f) - if filemerge(repo, f, f2, fd, wctx, mctx, move): + if filemerge(repo, f, f2, wctx, mctx): unresolved += 1 + else: + if f != fd: + repo.ui.debug(_("copying %s to %s\n") % (f, fd)) + repo.wwrite(fd, repo.wread(f)) + if move: + repo.ui.debug(_("removing %s\n") % f) + os.unlink(repo.wjoin(f)) + util.set_exec(repo.wjoin(fd), flag) merged += 1 elif m == "g": # get