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

mail settings
Submitter Siddharth Agarwal
Date Nov. 5, 2015, 8:12 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/11297/
State Superseded
Headers show


Siddharth Agarwal - Nov. 5, 2015, 8:12 a.m.
# HG changeset patch
# User Siddharth Agarwal <>
# 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.


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -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: