[PATCH 1 of 3 mergedriver V4] resolve: fix incorrect merge

Siddharth Agarwal sid0 at fb.com
Thu Nov 19 07:45:22 UTC 2015


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1447918998 28800
#      Wed Nov 18 23:43:18 2015 -0800
# Node ID 59604adedebf578e4c6a5e112dc7cb3e26587446
# Parent  03ca04230179233d40a73ce640fce6c6fa69574d
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r 59604adedebf
resolve: fix incorrect merge

The merge from stable into default was semantically incomplete -- a couple of
changes in preceding code had to be rewritten here.

This code only triggers for change/delete conflicts, so we can't test it yet.
We will soon be able to do it, though.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5704,7 +5704,11 @@ def resolve(ui, repo, *pats, **opts):
 
             # replace filemerge's .orig file with our resolve file
             a = repo.wjoin(f)
-            util.rename(a + ".resolve", a + ".orig")
+            try:
+                util.rename(a + ".resolve", cmdutil.origpath(ui, repo, a))
+            except OSError as inst:
+                if inst.errno != errno.ENOENT:
+                    raise
 
         ms.commit()
 


More information about the Mercurial-devel mailing list