Show More
@@ -196,6 +196,26 b' def hash(text, p1, p2):' | |||||
196 | s.update(text) |
|
196 | s.update(text) | |
197 | return s.digest() |
|
197 | return s.digest() | |
198 |
|
198 | |||
|
199 | class _testrevlog(object): | |||
|
200 | """minimalist fake revlog to use in doctests""" | |||
|
201 | ||||
|
202 | def __init__(self, data, density=0.5, mingap=0): | |||
|
203 | """data is an list of revision payload boundaries""" | |||
|
204 | self._data = data | |||
|
205 | self._srdensitythreshold = density | |||
|
206 | self._srmingapsize = mingap | |||
|
207 | ||||
|
208 | def start(self, rev): | |||
|
209 | if rev == 0: | |||
|
210 | return 0 | |||
|
211 | return self._data[rev - 1] | |||
|
212 | ||||
|
213 | def end(self, rev): | |||
|
214 | return self._data[rev] | |||
|
215 | ||||
|
216 | def length(self, rev): | |||
|
217 | return self.end(rev) - self.start(rev) | |||
|
218 | ||||
199 | def _trimchunk(revlog, revs, startidx, endidx=None): |
|
219 | def _trimchunk(revlog, revs, startidx, endidx=None): | |
200 | """returns revs[startidx:endidx] without empty trailing revs |
|
220 | """returns revs[startidx:endidx] without empty trailing revs | |
201 | """ |
|
221 | """ |
General Comments 0
You need to be logged in to leave comments.
Login now