Show More
@@ -1,133 +1,140 b'' | |||
|
1 | 1 | $ cat << EOF >> $HGRCPATH |
|
2 | 2 | > [format] |
|
3 | 3 | > usegeneraldelta=yes |
|
4 | 4 | > EOF |
|
5 | 5 | |
|
6 | 6 | $ hg init debugrevlog |
|
7 | 7 | $ cd debugrevlog |
|
8 | 8 | $ echo a > a |
|
9 | 9 | $ hg ci -Am adda |
|
10 | 10 | adding a |
|
11 | 11 | $ hg debugrevlog -m |
|
12 | 12 | format : 1 |
|
13 | 13 | flags : inline, generaldelta |
|
14 | 14 | |
|
15 | 15 | revisions : 1 |
|
16 | 16 | merges : 0 ( 0.00%) |
|
17 | 17 | normal : 1 (100.00%) |
|
18 | 18 | revisions : 1 |
|
19 | 19 | full : 1 (100.00%) |
|
20 | 20 | deltas : 0 ( 0.00%) |
|
21 | 21 | revision size : 44 |
|
22 | 22 | full : 44 (100.00%) |
|
23 | 23 | deltas : 0 ( 0.00%) |
|
24 | 24 | |
|
25 | 25 | chunks : 1 |
|
26 | 26 | 0x75 (u) : 1 (100.00%) |
|
27 | 27 | chunks size : 44 |
|
28 | 28 | 0x75 (u) : 44 (100.00%) |
|
29 | 29 | |
|
30 | 30 | avg chain length : 0 |
|
31 | 31 | max chain length : 0 |
|
32 | 32 | compression ratio : 0 |
|
33 | 33 | |
|
34 | 34 | uncompressed data size (min/max/avg) : 43 / 43 / 43 |
|
35 | 35 | full revision size (min/max/avg) : 44 / 44 / 44 |
|
36 | 36 | delta size (min/max/avg) : 0 / 0 / 0 |
|
37 | 37 | |
|
38 | 38 | Test debugindex, with and without the --debug flag |
|
39 | 39 | $ hg debugindex a |
|
40 | 40 | rev offset length ..... linkrev nodeid p1 p2 (re) |
|
41 | 41 | 0 0 3 .... 0 b789fdd96dc2 000000000000 000000000000 (re) |
|
42 | 42 | $ hg --debug debugindex a |
|
43 | 43 | rev offset length ..... linkrev nodeid p1 p2 (re) |
|
44 | 44 | 0 0 3 .... 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 (re) |
|
45 | 45 | $ hg debugindex -f 1 a |
|
46 | 46 | rev flag offset length size ..... link p1 p2 nodeid (re) |
|
47 | 47 | 0 0000 0 3 2 .... 0 -1 -1 b789fdd96dc2 (re) |
|
48 | 48 | $ hg --debug debugindex -f 1 a |
|
49 | 49 | rev flag offset length size ..... link p1 p2 nodeid (re) |
|
50 | 50 | 0 0000 0 3 2 .... 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (re) |
|
51 | 51 | |
|
52 | 52 | debugdelta chain basic output |
|
53 | 53 | |
|
54 | 54 | $ hg debugdeltachain -m |
|
55 | 55 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio |
|
56 | 56 | 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 |
|
57 | 57 | |
|
58 | 58 | $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n' |
|
59 | 59 | 0 1 1 |
|
60 | 60 | |
|
61 | 61 | $ hg debugdeltachain -m -Tjson |
|
62 | 62 | [ |
|
63 | 63 | { |
|
64 | 64 | "chainid": 1, |
|
65 | 65 | "chainlen": 1, |
|
66 | 66 | "chainratio": 1.02325581395, |
|
67 | 67 | "chainsize": 44, |
|
68 | 68 | "compsize": 44, |
|
69 | 69 | "deltatype": "base", |
|
70 | 70 | "extradist": 0, |
|
71 | 71 | "extraratio": 0.0, |
|
72 | 72 | "lindist": 44, |
|
73 | 73 | "prevrev": -1, |
|
74 | 74 | "rev": 0, |
|
75 | 75 | "uncompsize": 43 |
|
76 | 76 | } |
|
77 | 77 | ] |
|
78 | 78 | |
|
79 | 79 | Test max chain len |
|
80 | 80 | $ cat >> $HGRCPATH << EOF |
|
81 | 81 | > [format] |
|
82 | 82 | > maxchainlen=4 |
|
83 | 83 | > EOF |
|
84 | 84 | |
|
85 | 85 | $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a |
|
86 | 86 | $ hg ci -m a |
|
87 | 87 | $ printf "b\n" >> a |
|
88 | 88 | $ hg ci -m a |
|
89 | 89 | $ printf "c\n" >> a |
|
90 | 90 | $ hg ci -m a |
|
91 | 91 | $ printf "d\n" >> a |
|
92 | 92 | $ hg ci -m a |
|
93 | 93 | $ printf "e\n" >> a |
|
94 | 94 | $ hg ci -m a |
|
95 | 95 | $ printf "f\n" >> a |
|
96 | 96 | $ hg ci -m a |
|
97 | 97 | $ printf 'g\n' >> a |
|
98 | 98 | $ hg ci -m a |
|
99 | 99 | $ printf 'h\n' >> a |
|
100 | 100 | $ hg ci -m a |
|
101 | 101 | $ hg debugrevlog -d a |
|
102 | 102 | # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen |
|
103 | 103 | 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob) |
|
104 | 104 | 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob) |
|
105 | 105 | 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob) |
|
106 | 106 | 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob) |
|
107 | 107 | 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob) |
|
108 | 108 | 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob) |
|
109 | 109 | 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob) |
|
110 | 110 | 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob) |
|
111 | 111 | 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob) |
|
112 | 112 | $ cd .. |
|
113 | 113 | |
|
114 | 114 | Test internal debugstacktrace command |
|
115 | 115 | |
|
116 | 116 | $ cat > debugstacktrace.py << EOF |
|
117 | 117 | > from mercurial.util import debugstacktrace, dst, sys |
|
118 | 118 | > def f(): |
|
119 | > dst('hello world') | |
|
119 | > debugstacktrace(f=sys.stdout) | |
|
120 | > g() | |
|
120 | 121 | > def g(): |
|
122 | > dst('hello from g\\n', skip=1) | |
|
123 | > h() | |
|
124 | > def h(): | |
|
125 | > dst('hi ...\\nfrom h hidden in g', 1) | |
|
121 | 126 |
> |
|
122 | > debugstacktrace(skip=-5, f=sys.stdout) | |
|
123 | > g() | |
|
124 | 127 | > EOF |
|
125 | 128 | $ python debugstacktrace.py |
|
126 | hello world at: | |
|
127 |
debugstacktrace.py: |
|
|
128 | debugstacktrace.py:5 in g | |
|
129 | stacktrace at: | |
|
130 | debugstacktrace.py:10 in * (glob) | |
|
129 | 131 | debugstacktrace.py:3 in f |
|
130 | stacktrace at: | |
|
131 | debugstacktrace.py:7 *in * (glob) | |
|
132 |
debugstacktrace.py: |
|
|
133 | */util.py:* in debugstacktrace (glob) | |
|
132 | hello from g | |
|
133 | at: | |
|
134 | debugstacktrace.py:10 in * (glob) | |
|
135 | debugstacktrace.py:4 in f | |
|
136 | hi ... | |
|
137 | from h hidden in g at: | |
|
138 | debugstacktrace.py:10 in * (glob) | |
|
139 | debugstacktrace.py:4 in f | |
|
140 | debugstacktrace.py:7 in g |
General Comments 0
You need to be logged in to leave comments.
Login now