merge.applyupdates: create absentfilectxes for change/delete conflicts
authorSiddharth Agarwal <sid0@fb.com>
Sun, 22 Nov 2015 21:58:28 -0800
changeset 27091 2ce00de5cc0e
parent 27090 ef6f98473a48
child 27092 156985f2dec0
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.
mercurial/merge.py
--- a/mercurial/merge.py	Sun Nov 22 21:59:52 2015 -0800
+++ b/mercurial/merge.py	Sun Nov 22 21:58:28 2015 -0800
@@ -986,13 +986,20 @@
         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: