Show More
@@ -1036,13 +1036,21 b' class revlog(object):' | |||||
1036 | self._cache = (node, rev, text) |
|
1036 | self._cache = (node, rev, text) | |
1037 | return text |
|
1037 | return text | |
1038 |
|
1038 | |||
|
1039 | def hash(self, text, p1, p2): | |||
|
1040 | """Compute a node hash. | |||
|
1041 | ||||
|
1042 | Available as a function so that subclasses can replace the hash | |||
|
1043 | as needed. | |||
|
1044 | """ | |||
|
1045 | return hash(text, p1, p2) | |||
|
1046 | ||||
1039 | def _checkhash(self, text, node, rev): |
|
1047 | def _checkhash(self, text, node, rev): | |
1040 | p1, p2 = self.parents(node) |
|
1048 | p1, p2 = self.parents(node) | |
1041 | self.checkhash(text, p1, p2, node, rev) |
|
1049 | self.checkhash(text, p1, p2, node, rev) | |
1042 | return text |
|
1050 | return text | |
1043 |
|
1051 | |||
1044 | def checkhash(self, text, p1, p2, node, rev=None): |
|
1052 | def checkhash(self, text, p1, p2, node, rev=None): | |
1045 | if node != hash(text, p1, p2): |
|
1053 | if node != self.hash(text, p1, p2): | |
1046 | revornode = rev |
|
1054 | revornode = rev | |
1047 | if revornode is None: |
|
1055 | if revornode is None: | |
1048 | revornode = templatefilters.short(hex(node)) |
|
1056 | revornode = templatefilters.short(hex(node)) | |
@@ -1104,7 +1112,7 b' class revlog(object):' | |||||
1104 | if link == nullrev: |
|
1112 | if link == nullrev: | |
1105 | raise RevlogError(_("attempted to add linkrev -1 to %s") |
|
1113 | raise RevlogError(_("attempted to add linkrev -1 to %s") | |
1106 | % self.indexfile) |
|
1114 | % self.indexfile) | |
1107 | node = node or hash(text, p1, p2) |
|
1115 | node = node or self.hash(text, p1, p2) | |
1108 | if node in self.nodemap: |
|
1116 | if node in self.nodemap: | |
1109 | return node |
|
1117 | return node | |
1110 |
|
1118 |
General Comments 0
You need to be logged in to leave comments.
Login now