mercurial/filelog.py
branchstable
changeset 11541 ab9fa7a85dd9
parent 11540 2370e270a29a
child 13240 e5060aa22043
equal deleted inserted replaced
11540:2370e270a29a 11541:ab9fa7a85dd9
    60         """compare text with a given file revision
    60         """compare text with a given file revision
    61 
    61 
    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