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

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 19, 2015, 7:45 a.m.
Message ID <59604adedebf578e4c6a.1447919122@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11504/
State Accepted
Headers show

Comments

Siddharth Agarwal - Nov. 19, 2015, 7:45 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@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.

Patch

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()