Show More
@@ -73,18 +73,7 b' class filelog(revlog):' | |||||
73 | t2 = self.read(node) |
|
73 | t2 = self.read(node) | |
74 | return t2 == text |
|
74 | return t2 == text | |
75 |
|
75 | |||
76 | p1, p2 = self.parents(node) |
|
76 | return revlog.cmp(self, node, text) | |
77 | h = hash(text, p1, p2) |
|
|||
78 |
|
||||
79 | return h != node |
|
|||
80 |
|
||||
81 | def makenode(self, node, text): |
|
|||
82 | """calculate a file nodeid for text, descended or possibly |
|
|||
83 | unchanged from node""" |
|
|||
84 |
|
||||
85 | if self.cmp(node, text): |
|
|||
86 | return hash(text, node, nullid) |
|
|||
87 | return node |
|
|||
88 |
|
77 | |||
89 | def annotate(self, node): |
|
78 | def annotate(self, node): | |
90 |
|
79 |
@@ -766,6 +766,19 b' class revlog(object):' | |||||
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) |
General Comments 0
You need to be logged in to leave comments.
Login now