##// END OF EJS Templates
filelog: cmp: don't read data if hashes are identical (issue2273)...
Nicolas Dumazet -
r11541:ab9fa7a8 stable
parent child Browse files
Show More
@@ -62,9 +62,18 b' class filelog(revlog.revlog):'
62 returns True if text is different than what is stored.
62 returns True if text is different than what is stored.
63 """
63 """
64
64
65 # for renames, we have to go the slow way
65 t = text
66 if text.startswith('\1\n') or self.renamed(node):
66 if text.startswith('\1\n'):
67 t = '\1\n\1\n' + text
68
69 samehashes = not revlog.revlog.cmp(self, node, t)
70 if samehashes:
71 return False
72
73 # renaming a file produces a different hash, even if the data
74 # remains unchanged. Check if it's the case (slow):
75 if self.renamed(node):
67 t2 = self.read(node)
76 t2 = self.read(node)
68 return t2 != text
77 return t2 != text
69
78
70 return revlog.revlog.cmp(self, node, text)
79 return True
General Comments 0
You need to be logged in to leave comments. Login now