changeset 48759:d169e651066b

mergestate: use an early return for trivial merges `filemerge.filemerge()` returns `None` if no merge was needed because the two sides were identical. I'd like to move that to the caller. This is a little refactoring to prepare for that. Differential Revision: https://phab.mercurial-scm.org/D12153
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 07 Feb 2022 20:12:09 -0800
parents 7dad4665d223
children 93d6f0e7ba2f
files mercurial/mergestate.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/mergestate.py	Mon Feb 07 14:07:04 2022 -0800
+++ b/mercurial/mergestate.py	Mon Feb 07 20:12:09 2022 -0800
@@ -434,8 +434,11 @@
         if merge_ret is None:
             # If return value of merge is None, then there are no real conflict
             del self._state[dfile]
+            self._results[dfile] = None, None
             self._dirty = True
-        elif not merge_ret:
+            return None
+
+        if not merge_ret:
             self.mark(dfile, MERGE_RECORD_RESOLVED)
 
         action = None