mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
3433abb6a8
The current heuristic for deciding between storing delta and full texts is based on ratio of (sizeofdeltas)/(sizeoffulltext). In some cases (for example a manifest for ahuge repo) this approach can result in extremely long delta chains (~30,000) which are very slow to read. (In the case of a manifest ~500ms are added to every hg command because of that). This commit introduces "revlog.maxchainlength" configuration variable that will limit delta chain length.
82 lines
2.7 KiB
Raku
82 lines
2.7 KiB
Raku
$ hg init debugrevlog
|
|
$ cd debugrevlog
|
|
$ echo a > a
|
|
$ hg ci -Am adda
|
|
adding a
|
|
$ hg debugrevlog -m
|
|
format : 1
|
|
flags : inline
|
|
|
|
revisions : 1
|
|
merges : 0 ( 0.00%)
|
|
normal : 1 (100.00%)
|
|
revisions : 1
|
|
full : 1 (100.00%)
|
|
deltas : 0 ( 0.00%)
|
|
revision size : 44
|
|
full : 44 (100.00%)
|
|
deltas : 0 ( 0.00%)
|
|
|
|
avg chain length : 0
|
|
compression ratio : 0
|
|
|
|
uncompressed data size (min/max/avg) : 43 / 43 / 43
|
|
full revision size (min/max/avg) : 44 / 44 / 44
|
|
delta size (min/max/avg) : 0 / 0 / 0
|
|
|
|
Test max chain len
|
|
$ cat >> $HGRCPATH << EOF
|
|
> [revlog]
|
|
> maxchainlen=4
|
|
> EOF
|
|
|
|
$ echo "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
|
|
$ hg ci -m a
|
|
$ echo "b\n" >> a
|
|
$ hg ci -m a
|
|
$ echo "c\n" >> a
|
|
$ hg ci -m a
|
|
$ echo "d\n" >> a
|
|
$ hg ci -m a
|
|
$ echo "e\n" >> a
|
|
$ hg ci -m a
|
|
$ echo "f\n" >> a
|
|
$ hg ci -m a
|
|
$ echo 'g\n' >> a
|
|
$ hg ci -m a
|
|
$ echo 'h\n' >> a
|
|
$ hg ci -m a
|
|
$ hg debugrevlog -d a
|
|
# rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
|
|
0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
|
|
1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
|
|
2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
|
|
3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
|
|
4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
|
|
5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
|
|
6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
|
|
7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
|
|
8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
|
|
$ cd ..
|
|
|
|
Test internal debugstacktrace command
|
|
|
|
$ cat > debugstacktrace.py << EOF
|
|
> from mercurial.util import debugstacktrace, dst, sys
|
|
> def f():
|
|
> dst('hello world')
|
|
> def g():
|
|
> f()
|
|
> debugstacktrace(skip=-5, f=sys.stdout)
|
|
> g()
|
|
> EOF
|
|
$ python debugstacktrace.py
|
|
hello world at:
|
|
debugstacktrace.py:7 in * (glob)
|
|
debugstacktrace.py:5 in g
|
|
debugstacktrace.py:3 in f
|
|
stacktrace at:
|
|
debugstacktrace.py:7 *in * (glob)
|
|
debugstacktrace.py:6 *in g (glob)
|
|
*/util.py:* in debugstacktrace (glob)
|