Debian Codegraph @

tests/test-debug-revlog-stats.t

raw
1 Force revlog max inline value to be smaller than default
2
3 $ mkdir $TESTTMP/ext
4 $ cat << EOF > $TESTTMP/ext/small_inline.py
5 > from mercurial import revlog
6 > revlog._maxinline = 8
7 > EOF
8
9 $ cat << EOF >> $HGRCPATH
10 > [extensions]
11 > small_inline=$TESTTMP/ext/small_inline.py
12 > EOF
13
14 $ hg init repo
15 $ cd repo
16
17 Try on an empty repository
18
19 $ hg debug-revlog-stats
20 rev-count data-size inl type target
21
22 $ mkdir folder
23 $ touch a b folder/c folder/d
24 $ hg commit -Aqm 0
25 $ echo "text" > a
26 $ hg rm b
27 $ echo "longer string" > folder/d
28 $ hg commit -Aqm 1
29
30 Differences in data size observed with pure is due to different compression
31 algorithms
32
33 $ hg debug-revlog-stats
34 rev-count data-size inl type target
35 2 138 no changelog (zstd !)
36 2 137 no changelog (no-zstd !)
37 2 177 no manifest (zstd !)
38 2 168 no manifest (no-zstd !)
39 2 6 yes file a
40 1 0 yes file b
41 1 0 yes file folder/c
42 2 15 no file folder/d
43
44 Test 'changelog' command argument
45
46 $ hg debug-revlog-stats -c
47 rev-count data-size inl type target
48 2 138 no changelog (zstd !)
49 2 137 no changelog (no-zstd !)
50
51 Test 'manifest' command argument
52
53 $ hg debug-revlog-stats -m
54 rev-count data-size inl type target
55 2 177 no manifest (zstd !)
56 2 168 no manifest (no-zstd !)
57
58 Test 'file' command argument
59
60 $ hg debug-revlog-stats -f
61 rev-count data-size inl type target
62 2 6 yes file a
63 1 0 yes file b
64 1 0 yes file folder/c
65 2 15 no file folder/d
66
67 Test multiple command arguments
68
69 $ hg debug-revlog-stats -cm
70 rev-count data-size inl type target
71 2 138 no changelog (zstd !)
72 2 137 no changelog (no-zstd !)
73 2 177 no manifest (zstd !)
74 2 168 no manifest (no-zstd !)
75