Patchwork [2,of,5] merge: set _local/_other for conflictfree merges

login
register
mail settings
Submitter timeless@mozdev.org
Date March 22, 2016, 10:21 p.m.
Message ID <0ff0274cf3ca9d66dd86.1458685309@waste.org>
Download mbox | patch
Permalink /patch/14028/
State Superseded
Headers show

Comments

timeless@mozdev.org - March 22, 2016, 10:21 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1458226168 0
#      Thu Mar 17 14:49:28 2016 +0000
# Node ID 0ff0274cf3ca9d66dd86d0f9431a06bc2ba11535
# Parent  994882c8bff031e25365a5ebf02451eba8c6d067
merge: set _local/_other for conflictfree merges
timeless - March 22, 2016, 10:30 p.m.
farnz has convinced me that we don't want to do this commit at all.
I'm reworking the rest of this series.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -167,6 +167,14 @@ 
                 self._stateextras[filename] = extras
             elif not rtype.islower():
                 unsupported.add(rtype)
+        if self._local is None or self._other is None:
+            parents = self._repo[None].parents()
+            if len(parents) == 2:
+                # we have two parents, we have a merge, but no conflicts.
+                p1, p2 = parents
+                self._local = p1.node()
+                self._other = p2.node()
+
         self._results = {}
         self._dirty = False