diff mercurial/mergestate.py @ 48427:38941a28406a

mergestate: merge `preresolve()` into `resolve()` The separation between `preresolve()` and `resolve()` was something added for the "merge driver" feature. Since we removed that in 32ce4cbaec4b (mergedriver: delete it, 2020-09-17), we don't need the separation anymore. More cleanups will follow. Differential Revision: https://phab.mercurial-scm.org/D11855
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 02 Dec 2021 22:59:36 -0800
parents 6f54afb094bd
children c25a67cfc291
line wrap: on
line diff
--- a/mercurial/mergestate.py	Fri Dec 03 21:50:25 2021 -0800
+++ b/mercurial/mergestate.py	Thu Dec 02 22:59:36 2021 -0800
@@ -408,17 +408,14 @@
 
         return complete, merge_ret
 
-    def preresolve(self, dfile, wctx):
-        """run premerge process for dfile
-
-        Returns whether the merge is complete, and the exit code."""
-        return self._resolve(True, dfile, wctx)
-
     def resolve(self, dfile, wctx):
-        """run merge process (assuming premerge was run) for dfile
+        """run merge process for dfile
 
         Returns the exit code of the merge."""
-        return self._resolve(False, dfile, wctx)[1]
+        complete, r = self._resolve(True, dfile, wctx)
+        if not complete:
+            r = self._resolve(False, dfile, wctx)[1]
+        return r
 
     def counts(self):
         """return counts for updated, merged and removed files in this