diff mercurial/filelog.py @ 46714:6f4a481f182a

merge: with stable
author Augie Fackler <augie@google.com>
date Fri, 12 Mar 2021 13:13:13 -0500
parents f7b61ad3c64a b994db7c4d1e
children f63299ee7e4d
line wrap: on
line diff
--- a/mercurial/filelog.py	Wed Mar 10 18:24:23 2021 +0100
+++ b/mercurial/filelog.py	Fri Mar 12 13:13:13 2021 -0500
@@ -280,14 +280,12 @@
             return super(narrowfilelog, self).size(rev)
 
     def cmp(self, node, text):
-        different = super(narrowfilelog, self).cmp(node, text)
+        # We don't call `super` because narrow parents can be buggy in case of a
+        # ambiguous dirstate. Always take the slow path until there is a better
+        # fix, see issue6150.
 
-        # Because renamed() may lie, we may get false positives for
-        # different content. Check for this by comparing against the original
-        # renamed() implementation.
-        if different:
-            if super(narrowfilelog, self).renamed(node):
-                t2 = self.read(node)
-                return t2 != text
+        # Censored files compare against the empty file.
+        if self.iscensored(self.rev(node)):
+            return text != b''
 
-        return different
+        return self.read(node) != text