Patchwork [2,of,7,mergedriver] mergestate._resolve: don't return the action any more

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 21, 2015, 1:03 a.m.
Message ID <2712ae8efb1942f3ac0f.1448067837@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11558/
State Accepted
Commit 6373330155b28512762406b53b0d39fee07a736e
Delegated to: Martin von Zweigbergk
Headers show

Comments

Siddharth Agarwal - Nov. 21, 2015, 1:03 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1448065967 28800
#      Fri Nov 20 16:32:47 2015 -0800
# Node ID 2712ae8efb1942f3ac0f1b3b3a67e5fb3a8df9e3
# Parent  f8f5e2ddd13d49db6dfbcc34a38f872189f04b89
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r 2712ae8efb19
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.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -415,7 +415,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, 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 @@  class mergestate(object):
         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 @@  class mergestate(object):
                 # 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 @@  class mergestate(object):
         """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: