comparison mercurial/revlog.py @ 2910:5df3e5cf16bc

Move cmp bits from filelog to revlog
author Matt Mackall <mpm@selenic.com>
date Tue, 15 Aug 2006 14:18:13 -0500
parents 345bac2bc4ec
children baa3873eb387
comparison
equal deleted inserted replaced
2909:20b95aef3fe0 2910:5df3e5cf16bc
764 if len(id) == 20 and id in self.nodemap: 764 if len(id) == 20 and id in self.nodemap:
765 return id 765 return id
766 766
767 raise RevlogError(_("No match found")) 767 raise RevlogError(_("No match found"))
768 768
769 def cmp(self, node, text):
770 """compare text with a given file revision"""
771 p1, p2 = self.parents(node)
772 return hash(text, p1, p2) != node
773
774 def makenode(self, node, text):
775 """calculate a file nodeid for text, descended or possibly
776 unchanged from node"""
777
778 if self.cmp(node, text):
779 return hash(text, node, nullid)
780 return node
781
769 def diff(self, a, b): 782 def diff(self, a, b):
770 """return a delta between two revisions""" 783 """return a delta between two revisions"""
771 return mdiff.textdiff(a, b) 784 return mdiff.textdiff(a, b)
772 785
773 def patches(self, t, pl): 786 def patches(self, t, pl):