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