Mercurial > hg
comparison mercurial/revlog.py @ 14075:bc101902a68d
revlog: introduce _chunkbase to allow filelog to override
Used by revlog.revision to retrieve the base-chunk in a delta chain.
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Sat, 30 Apr 2011 16:33:47 +0200 |
parents | e4bfb9c337f3 |
children | bd1cbfe5db5c |
comparison
equal
deleted
inserted
replaced
14074:e8271159c8c2 | 14075:bc101902a68d |
---|---|
820 return self._getchunk(start, length) | 820 return self._getchunk(start, length) |
821 | 821 |
822 def _chunk(self, rev): | 822 def _chunk(self, rev): |
823 return decompress(self._chunkraw(rev, rev)) | 823 return decompress(self._chunkraw(rev, rev)) |
824 | 824 |
825 def _chunkbase(self, rev): | |
826 return self._chunk(rev) | |
827 | |
825 def _chunkclear(self): | 828 def _chunkclear(self): |
826 self._chunkcache = (0, '') | 829 self._chunkcache = (0, '') |
827 | 830 |
828 def deltaparent(self, rev): | 831 def deltaparent(self, rev): |
829 """return previous revision or parentrev according to flags""" | 832 """return previous revision or parentrev according to flags""" |
882 # drop cache to save memory | 885 # drop cache to save memory |
883 self._cache = None | 886 self._cache = None |
884 | 887 |
885 self._chunkraw(base, rev) | 888 self._chunkraw(base, rev) |
886 if text is None: | 889 if text is None: |
887 text = self._chunk(base) | 890 text = self._chunkbase(base) |
888 | 891 |
889 bins = [self._chunk(r) for r in chain] | 892 bins = [self._chunk(r) for r in chain] |
890 text = mdiff.patches(text, bins) | 893 text = mdiff.patches(text, bins) |
891 | 894 |
892 text = self._checkhash(text, node, rev) | 895 text = self._checkhash(text, node, rev) |