Patchwork [5,of,5,changedelete] merge.mergestate: return dirstate action from _resolve

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 5, 2015, 8:12 a.m.
Message ID <5e2a93a9bba03526616f.1446711122@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11297/
State Superseded
Headers show

Comments

Siddharth Agarwal - Nov. 5, 2015, 8:12 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1446709713 28800
#      Wed Nov 04 23:48:33 2015 -0800
# Node ID 5e2a93a9bba03526616f70e62298c8007a1da12b
# Parent  7514e2e35e70661a7783668cf9cddd949ab9cd76
merge.mergestate: return dirstate action from _resolve

In upcoming patches we're going to handle these actions at the preresolve and
resolve layers.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -359,7 +359,7 @@  class mergestate(object):
     def _resolve(self, preresolve, dfile, wctx, labels=None):
         """rerun merge process for file path `dfile`"""
         if self[dfile] in 'rd':
-            return True, 0
+            return True, 0, None
         stateentry = self._state[dfile]
         state, hash, lfile, afile, anode, ofile, onode, flags = stateentry
         octx = self._repo[self._other]
@@ -394,19 +394,21 @@  class mergestate(object):
             self._dirty = True
         elif not r:
             self.mark(dfile, 'r')
-        return complete, r
+        return complete, r, action
 
     def preresolve(self, dfile, wctx, labels=None):
         """run premerge process for dfile
 
         Returns whether the merge is complete, and the exit code."""
-        return self._resolve(True, dfile, wctx, labels=labels)
+        complete, r, action = self._resolve(True, dfile, wctx, labels=labels)
+        return complete, r
 
     def resolve(self, dfile, wctx, labels=None):
         """run merge process (assuming premerge was run) for dfile
 
         Returns the exit code of the merge."""
-        return self._resolve(False, dfile, wctx, labels=labels)[1]
+        complete, r, action = self._resolve(False, dfile, wctx, labels=labels)
+        return r
 
 def _checkunknownfile(repo, wctx, mctx, f, f2=None):
     if f2 is None: