Show More
@@ -0,0 +1,23 b'' | |||||
|
1 | Check whether size of generaldelta revlog is not bigger than its | |||
|
2 | regular equivalent. Test would fail if generaldelta was naive | |||
|
3 | implementation of parentdelta: third manifest revision would be fully | |||
|
4 | inserted due to big distance from its paren revision (zero). | |||
|
5 | ||||
|
6 | $ hg init repo | |||
|
7 | $ cd repo | |||
|
8 | $ echo foo > foo | |||
|
9 | $ echo bar > bar | |||
|
10 | $ hg commit -q -Am boo | |||
|
11 | $ hg clone --pull . ../gdrepo -q --config format.generaldelta=yes | |||
|
12 | $ for r in 1 2 3; do | |||
|
13 | > echo $r > foo | |||
|
14 | > hg commit -q -m $r | |||
|
15 | > hg up -q -r 0 | |||
|
16 | > hg pull . -q -r $r -R ../gdrepo | |||
|
17 | > done | |||
|
18 | $ cd .. | |||
|
19 | $ regsize=`du -s -b repo/.hg/store/00manifest.i | cut -f 1` | |||
|
20 | $ gdsize=`du -s -b gdrepo/.hg/store/00manifest.i | cut -f 1` | |||
|
21 | $ if ((regsize < gdsize)); then | |||
|
22 | > echo 'generaldelta increased size of a revlog!' | |||
|
23 | > fi |
@@ -200,7 +200,7 b' class revlog(object):' | |||||
200 | self.datafile = indexfile[:-2] + ".d" |
|
200 | self.datafile = indexfile[:-2] + ".d" | |
201 | self.opener = opener |
|
201 | self.opener = opener | |
202 | self._cache = None |
|
202 | self._cache = None | |
203 |
self._basecache = |
|
203 | self._basecache = None | |
204 | self._chunkcache = (0, '') |
|
204 | self._chunkcache = (0, '') | |
205 | self.index = [] |
|
205 | self.index = [] | |
206 | self._pcache = {} |
|
206 | self._pcache = {} | |
@@ -1095,6 +1095,8 b' class revlog(object):' | |||||
1095 | offset = self.end(prev) |
|
1095 | offset = self.end(prev) | |
1096 | flags = 0 |
|
1096 | flags = 0 | |
1097 | d = None |
|
1097 | d = None | |
|
1098 | if self._basecache is None: | |||
|
1099 | self._basecache = (prev, self.chainbase(prev)) | |||
1098 | basecache = self._basecache |
|
1100 | basecache = self._basecache | |
1099 | p1r, p2r = self.rev(p1), self.rev(p2) |
|
1101 | p1r, p2r = self.rev(p1), self.rev(p2) | |
1100 |
|
1102 |
General Comments 0
You need to be logged in to leave comments.
Login now