mergestate._resolve: don't return the action any more
authorSiddharth Agarwal <sid0@fb.com>
Fri, 20 Nov 2015 16:32:47 -0800
changeset 27075 6373330155b2
parent 27074 78b0c88ab0db
child 27076 09139ccf3085
mergestate._resolve: don't return the action any more This is a partial backout of an earlier diff -- now that we're storing the results in a dict, we don't actually need this any more.
mercurial/merge.py
--- a/mercurial/merge.py	Fri Nov 20 16:08:22 2015 -0800
+++ b/mercurial/merge.py	Fri Nov 20 16:32:47 2015 -0800
@@ -415,7 +415,7 @@
     def _resolve(self, preresolve, dfile, wctx, labels=None):
         """rerun merge process for file path `dfile`"""
         if self[dfile] in 'rd':
-            return True, 0, None
+            return True, 0
         stateentry = self._state[dfile]
         state, hash, lfile, afile, anode, ofile, onode, flags = stateentry
         octx = self._repo[self._other]
@@ -455,8 +455,8 @@
         elif not r:
             self.mark(dfile, 'r')
 
-        action = None
         if complete:
+            action = None
             if deleted:
                 if not fcd.isabsent():
                     # cd: remote picked (or otherwise deleted)
@@ -470,7 +470,7 @@
                 # else: regular merges (no action necessary)
             self._results[dfile] = r, action
 
-        return complete, r, action
+        return complete, r
 
     def _filectxorabsent(self, hexnode, ctx, f):
         if hexnode == nullhex:
@@ -482,15 +482,13 @@
         """run premerge process for dfile
 
         Returns whether the merge is complete, and the exit code."""
-        complete, r, action = self._resolve(True, dfile, wctx, labels=labels)
-        return complete, r
+        return self._resolve(True, dfile, wctx, labels=labels)
 
     def resolve(self, dfile, wctx, labels=None):
         """run merge process (assuming premerge was run) for dfile
 
         Returns the exit code of the merge."""
-        complete, r, action = self._resolve(False, dfile, wctx, labels=labels)
-        return r
+        return self._resolve(False, dfile, wctx, labels=labels)[1]
 
 def _checkunknownfile(repo, wctx, mctx, f, f2=None):
     if f2 is None: