Patchwork [5,of,5,mergedriver] merge.applyupdates: create absentfilectxes for change/delete conflicts

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 23, 2015, 6 a.m.
Message ID <a4fcfc8433ef8e71bbc0.1448258451@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11595/
State Accepted
Headers show

Comments

Siddharth Agarwal - Nov. 23, 2015, 6 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1448258308 28800
#      Sun Nov 22 21:58:28 2015 -0800
# Node ID a4fcfc8433ef8e71bbc03706b8d1164213c74c68
# Parent  39b2bc59e3b1d7ef13c996b30fafa293c6116854
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r a4fcfc8433ef
merge.applyupdates: create absentfilectxes for change/delete conflicts

At the moment no change/delete conflicts get to this point -- we're going to
make that happen in an upcoming patch.
Martin von Zweigbergk - Nov. 23, 2015, 6:33 p.m.
This looks harmless, pushed to the clowncopter.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -986,13 +986,20 @@  def applyupdates(repo, actions, wctx, mc
         f1, f2, fa, move, anc = args
         if f == '.hgsubstate': # merged internally
             continue
-        repo.ui.debug(" preserving %s for resolve of %s\n" % (f1, f))
-        fcl = wctx[f1]
-        fco = mctx[f2]
+        if f1 is None:
+            fcl = filemerge.absentfilectx(wctx, fa)
+        else:
+            repo.ui.debug(" preserving %s for resolve of %s\n" % (f1, f))
+            fcl = wctx[f1]
+        if f2 is None:
+            fco = filemerge.absentfilectx(mctx, fa)
+        else:
+            fco = mctx[f2]
         actx = repo[anc]
         if fa in actx:
             fca = actx[fa]
         else:
+            # TODO: move to absentfilectx
             fca = repo.filectx(f1, fileid=nullrev)
         ms.add(fcl, fco, fca, f)
         if f1 != f and move: