mercurial/dagop.py
changeset 33284 b2670290eab4
parent 33080 a53bfc2845f2
child 34065 c6c8a52e28c9
--- a/mercurial/dagop.py	Tue Jul 04 22:35:52 2017 -0700
+++ b/mercurial/dagop.py	Wed Jul 05 13:54:53 2017 +0200
@@ -287,12 +287,13 @@
                 continue
             inrangep, linerange1 = _changesrange(c, p, linerange2, diffopts)
             inrange = inrange or inrangep
-            # If revision 'i' has been seen (it's a merge), we assume that its
-            # line range is the same independently of which parents was used
-            # to compute it.
-            assert i not in seen or seen[i][1] == linerange1, (
-                'computed line range for %s is not consistent between '
-                'ancestor branches' % c)
+            # If revision 'i' has been seen (it's a merge) and the line range
+            # previously computed differs from the one we just got, we take the
+            # surrounding interval. This is conservative but avoids loosing
+            # information.
+            if i in seen and seen[i][1] != linerange1:
+                lbs, ubs = zip(linerange1, seen[i][1])
+                linerange1 = min(lbs), max(ubs)
             seen[i] = c, linerange1
         if inrange:
             yield c, linerange1