--- a/mercurial/filelog.py Tue Aug 15 14:06:50 2006 -0500
+++ b/mercurial/filelog.py Tue Aug 15 14:18:13 2006 -0500
@@ -73,18 +73,7 @@
t2 = self.read(node)
return t2 == text
- p1, p2 = self.parents(node)
- h = hash(text, p1, p2)
-
- return h != node
-
- def makenode(self, node, text):
- """calculate a file nodeid for text, descended or possibly
- unchanged from node"""
-
- if self.cmp(node, text):
- return hash(text, node, nullid)
- return node
+ return revlog.cmp(self, node, text)
def annotate(self, node):
--- a/mercurial/revlog.py Tue Aug 15 14:06:50 2006 -0500
+++ b/mercurial/revlog.py Tue Aug 15 14:18:13 2006 -0500
@@ -766,6 +766,19 @@
raise RevlogError(_("No match found"))
+ def cmp(self, node, text):
+ """compare text with a given file revision"""
+ p1, p2 = self.parents(node)
+ return hash(text, p1, p2) != node
+
+ def makenode(self, node, text):
+ """calculate a file nodeid for text, descended or possibly
+ unchanged from node"""
+
+ if self.cmp(node, text):
+ return hash(text, node, nullid)
+ return node
+
def diff(self, a, b):
"""return a delta between two revisions"""
return mdiff.textdiff(a, b)