Patchwork [4,of,6,mergedriver] merge.mergestate._resolve: also return completed status

login
register
mail settings
Submitter Siddharth Agarwal
Date Oct. 12, 2015, 8:09 p.m.
Message ID <f7af6a6a06e73338b8a2.1444680580@dev6666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/10971/
State Accepted
Headers show

Comments

Siddharth Agarwal - Oct. 12, 2015, 8:09 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1444613874 25200
#      Sun Oct 11 18:37:54 2015 -0700
# Node ID f7af6a6a06e73338b8a2536035a40e8303a5175f
# Parent  97b41189812468236377eaf70a153fb5e6da2a1e
merge.mergestate._resolve: also return completed status

We'll need this for a new 'preresolve' function we're adding.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -290,7 +290,7 @@  class mergestate(object):
     def _resolve(self, dfile, wctx, labels=None):
         """rerun merge process for file path `dfile`"""
         if self[dfile] == 'r':
-            return 0
+            return True, 0
         stateentry = self._state[dfile]
         state, hash, lfile, afile, anode, ofile, onode, flags = stateentry
         octx = self._repo[self._other]
@@ -321,11 +321,11 @@  class mergestate(object):
             self._dirty = True
         elif not r:
             self.mark(dfile, 'r')
-        return r
+        return complete, r
 
     def resolve(self, dfile, wctx, labels=None):
         """rerun merge process for file path `dfile`"""
-        return self._resolve(dfile, wctx, labels=labels)
+        return self._resolve(False, dfile, wctx, labels=labels)[1]
 
 def _checkunknownfile(repo, wctx, mctx, f, f2=None):
     if f2 is None: