1086 if text is None: |
1086 if text is None: |
1087 text = self._chunk(base) |
1087 text = self._chunk(base) |
1088 |
1088 |
1089 bins = [self._chunk(r) for r in chain] |
1089 bins = [self._chunk(r) for r in chain] |
1090 text = mdiff.patches(text, bins) |
1090 text = mdiff.patches(text, bins) |
|
1091 |
|
1092 text = self._checkhash(text, node) |
|
1093 |
|
1094 self._cache = (node, rev, text) |
|
1095 return text |
|
1096 |
|
1097 def _checkhash(self, text, node): |
1091 p1, p2 = self.parents(node) |
1098 p1, p2 = self.parents(node) |
1092 if (node != hash(text, p1, p2) and |
1099 if (node != hash(text, p1, p2) and |
1093 not (self.flags(rev) & REVIDX_PUNCHED_FLAG)): |
1100 not (self.flags(rev) & REVIDX_PUNCHED_FLAG)): |
1094 raise RevlogError(_("integrity check failed on %s:%d") |
1101 raise RevlogError(_("integrity check failed on %s:%d") |
1095 % (self.indexfile, rev)) |
1102 % (self.indexfile, rev)) |
1096 |
|
1097 self._cache = (node, rev, text) |
|
1098 return text |
1103 return text |
1099 |
1104 |
1100 def checkinlinesize(self, tr, fp=None): |
1105 def checkinlinesize(self, tr, fp=None): |
1101 if not self._inline or (self.start(-2) + self.length(-2)) < _maxinline: |
1106 if not self._inline or (self.start(-2) + self.length(-2)) < _maxinline: |
1102 return |
1107 return |