Show More
@@ -618,12 +618,19 b' class revlog(object):' | |||||
618 | and NodemapRevlogIO is not None |
|
618 | and NodemapRevlogIO is not None | |
619 | ) |
|
619 | ) | |
620 |
|
620 | |||
|
621 | use_rust_index = False | |||
|
622 | if rustrevlog is not None: | |||
|
623 | if self.nodemap_file is not None: | |||
|
624 | use_rust_index = True | |||
|
625 | else: | |||
|
626 | use_rust_index = self.opener.options.get(b'rust.index') | |||
|
627 | ||||
621 | self._io = revlogio() |
|
628 | self._io = revlogio() | |
622 | if self.version == REVLOGV0: |
|
629 | if self.version == REVLOGV0: | |
623 | self._io = revlogoldio() |
|
630 | self._io = revlogoldio() | |
624 | elif devel_nodemap: |
|
631 | elif devel_nodemap: | |
625 | self._io = NodemapRevlogIO() |
|
632 | self._io = NodemapRevlogIO() | |
626 | elif rustrevlog is not None and self.opener.options.get(b'rust.index'): |
|
633 | elif use_rust_index: | |
627 | self._io = rustrevlogio() |
|
634 | self._io = rustrevlogio() | |
628 | try: |
|
635 | try: | |
629 | d = self._io.parseindex(indexdata, self._inline) |
|
636 | d = self._io.parseindex(indexdata, self._inline) |
@@ -2,7 +2,6 b'' | |||||
2 | Test the persistent on-disk nodemap |
|
2 | Test the persistent on-disk nodemap | |
3 | =================================== |
|
3 | =================================== | |
4 |
|
4 | |||
5 |
|
||||
6 | $ hg init test-repo |
|
5 | $ hg init test-repo | |
7 | $ cd test-repo |
|
6 | $ cd test-repo | |
8 | $ cat << EOF >> .hg/hgrc |
|
7 | $ cat << EOF >> .hg/hgrc | |
@@ -26,6 +25,35 b' Simple lookup works' | |||||
26 | $ hg log -r "$ANYNODE" --template '{rev}\n' |
|
25 | $ hg log -r "$ANYNODE" --template '{rev}\n' | |
27 | 5000 |
|
26 | 5000 | |
28 |
|
27 | |||
|
28 | ||||
|
29 | #if rust | |||
|
30 | ||||
|
31 | $ f --sha256 .hg/store/00changelog-*.nd | |||
|
32 | .hg/store/00changelog-????????????????.nd: sha256=1e38e9ffaa45cad13f15c1a9880ad606f4241e8beea2f61b4d5365abadfb55f6 (glob) | |||
|
33 | $ hg debugnodemap --dump-new | f --sha256 --size | |||
|
34 | size=122880, sha256=1e38e9ffaa45cad13f15c1a9880ad606f4241e8beea2f61b4d5365abadfb55f6 | |||
|
35 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size | |||
|
36 | size=122880, sha256=1e38e9ffaa45cad13f15c1a9880ad606f4241e8beea2f61b4d5365abadfb55f6 | |||
|
37 | 0000: 00 00 00 76 00 00 01 65 00 00 00 95 00 00 01 34 |...v...e.......4| | |||
|
38 | 0010: 00 00 00 19 00 00 01 69 00 00 00 ab 00 00 00 4b |.......i.......K| | |||
|
39 | 0020: 00 00 00 07 00 00 01 4c 00 00 00 f8 00 00 00 8f |.......L........| | |||
|
40 | 0030: 00 00 00 c0 00 00 00 a7 00 00 00 89 00 00 01 46 |...............F| | |||
|
41 | 0040: 00 00 00 92 00 00 01 bc 00 00 00 71 00 00 00 ac |...........q....| | |||
|
42 | 0050: 00 00 00 af 00 00 00 b4 00 00 00 34 00 00 01 ca |...........4....| | |||
|
43 | 0060: 00 00 00 23 00 00 01 45 00 00 00 2d 00 00 00 b2 |...#...E...-....| | |||
|
44 | 0070: 00 00 00 56 00 00 01 0f 00 00 00 4e 00 00 02 4c |...V.......N...L| | |||
|
45 | 0080: 00 00 00 e7 00 00 00 cd 00 00 01 5b 00 00 00 78 |...........[...x| | |||
|
46 | 0090: 00 00 00 e3 00 00 01 8e 00 00 00 4f 00 00 00 b1 |...........O....| | |||
|
47 | 00a0: 00 00 00 30 00 00 00 11 00 00 00 25 00 00 00 d2 |...0.......%....| | |||
|
48 | 00b0: 00 00 00 ec 00 00 00 69 00 00 01 2b 00 00 01 2e |.......i...+....| | |||
|
49 | 00c0: 00 00 00 aa 00 00 00 15 00 00 00 3a 00 00 01 4e |...........:...N| | |||
|
50 | 00d0: 00 00 00 4d 00 00 00 9d 00 00 00 8e 00 00 00 a4 |...M............| | |||
|
51 | 00e0: 00 00 00 c3 00 00 00 eb 00 00 00 29 00 00 00 ad |...........)....| | |||
|
52 | 00f0: 00 00 01 3a 00 00 01 32 00 00 00 04 00 00 00 53 |...:...2.......S| | |||
|
53 | ||||
|
54 | ||||
|
55 | #else | |||
|
56 | ||||
29 | $ f --sha256 .hg/store/00changelog-*.nd |
|
57 | $ f --sha256 .hg/store/00changelog-*.nd | |
30 | .hg/store/00changelog-????????????????.nd: sha256=b961925120e1c9bc345c199b2cc442abc477029fdece37ef9d99cbe59c0558b7 (glob) |
|
58 | .hg/store/00changelog-????????????????.nd: sha256=b961925120e1c9bc345c199b2cc442abc477029fdece37ef9d99cbe59c0558b7 (glob) | |
31 | $ hg debugnodemap --dump-new | f --sha256 --size |
|
59 | $ hg debugnodemap --dump-new | f --sha256 --size | |
@@ -48,6 +76,9 b' Simple lookup works' | |||||
48 | 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
76 | 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
49 | 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
77 | 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
50 | 00f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
78 | 00f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
|
79 | ||||
|
80 | #endif | |||
|
81 | ||||
51 | $ hg debugnodemap --check |
|
82 | $ hg debugnodemap --check | |
52 | revision in index: 5001 |
|
83 | revision in index: 5001 | |
53 | revision in nodemap: 5001 |
|
84 | revision in nodemap: 5001 | |
@@ -60,19 +91,20 b' add a new commit' | |||||
60 | $ hg add foo |
|
91 | $ hg add foo | |
61 | $ hg ci -m 'foo' |
|
92 | $ hg ci -m 'foo' | |
62 |
|
93 | |||
63 | #if pure |
|
94 | #if no-pure no-rust | |
|
95 | $ hg debugnodemap --metadata | |||
|
96 | uid: ???????????????? (glob) | |||
|
97 | tip-rev: 5001 | |||
|
98 | data-length: 122880 | |||
|
99 | data-unused: 0 | |||
|
100 | #else | |||
64 | $ hg debugnodemap --metadata |
|
101 | $ hg debugnodemap --metadata | |
65 | uid: ???????????????? (glob) |
|
102 | uid: ???????????????? (glob) | |
66 | tip-rev: 5001 |
|
103 | tip-rev: 5001 | |
67 | data-length: 123072 |
|
104 | data-length: 123072 | |
68 | data-unused: 192 |
|
105 | data-unused: 192 | |
69 | #else |
|
|||
70 | $ hg debugnodemap --metadata |
|
|||
71 | uid: ???????????????? (glob) |
|
|||
72 | tip-rev: 5001 |
|
|||
73 | data-length: 122880 |
|
|||
74 | data-unused: 0 |
|
|||
75 | #endif |
|
106 | #endif | |
|
107 | ||||
76 | $ f --size .hg/store/00changelog.n |
|
108 | $ f --size .hg/store/00changelog.n | |
77 | .hg/store/00changelog.n: size=42 |
|
109 | .hg/store/00changelog.n: size=42 | |
78 |
|
110 | |||
@@ -81,11 +113,16 b' add a new commit' | |||||
81 | #if pure |
|
113 | #if pure | |
82 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
114 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
83 | .hg/store/00changelog-????????????????.nd: size=123072, sha256=136472751566c8198ff09e306a7d2f9bd18bd32298d614752b73da4d6df23340 (glob) |
|
115 | .hg/store/00changelog-????????????????.nd: size=123072, sha256=136472751566c8198ff09e306a7d2f9bd18bd32298d614752b73da4d6df23340 (glob) | |
|
116 | #endif | |||
84 |
|
117 | |||
85 | #else |
|
118 | #if rust | |
|
119 | $ f --sha256 .hg/store/00changelog-*.nd --size | |||
|
120 | .hg/store/00changelog-????????????????.nd: size=123072, sha256=ccc8a43310ace13812fcc648683e259346754ef934c12dd238cf9b7fadfe9a4b (glob) | |||
|
121 | #endif | |||
|
122 | ||||
|
123 | #if no-pure no-rust | |||
86 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
124 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
87 | .hg/store/00changelog-????????????????.nd: size=122880, sha256=bfafebd751c4f6d116a76a37a1dee2a251747affe7efbcc4f4842ccc746d4db9 (glob) |
|
125 | .hg/store/00changelog-????????????????.nd: size=122880, sha256=bfafebd751c4f6d116a76a37a1dee2a251747affe7efbcc4f4842ccc746d4db9 (glob) | |
88 |
|
||||
89 | #endif |
|
126 | #endif | |
90 |
|
127 | |||
91 | $ hg debugnodemap --check |
|
128 | $ hg debugnodemap --check | |
@@ -115,8 +152,17 b' Test code path without mmap' | |||||
115 | data-unused: 384 |
|
152 | data-unused: 384 | |
116 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
153 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
117 | .hg/store/00changelog-????????????????.nd: size=123328, sha256=10d26e9776b6596af0f89143a54eba8cc581e929c38242a02a7b0760698c6c70 (glob) |
|
154 | .hg/store/00changelog-????????????????.nd: size=123328, sha256=10d26e9776b6596af0f89143a54eba8cc581e929c38242a02a7b0760698c6c70 (glob) | |
118 |
|
155 | #endif | ||
119 | #else |
|
156 | #if rust | |
|
157 | $ hg debugnodemap --metadata | |||
|
158 | uid: ???????????????? (glob) | |||
|
159 | tip-rev: 5002 | |||
|
160 | data-length: 123328 | |||
|
161 | data-unused: 384 | |||
|
162 | $ f --sha256 .hg/store/00changelog-*.nd --size | |||
|
163 | .hg/store/00changelog-????????????????.nd: size=123328, sha256=081eec9eb6708f2bf085d939b4c97bc0b6762bc8336bc4b93838f7fffa1516bf (glob) | |||
|
164 | #endif | |||
|
165 | #if no-pure no-rust | |||
120 | $ hg debugnodemap --metadata |
|
166 | $ hg debugnodemap --metadata | |
121 | uid: ???????????????? (glob) |
|
167 | uid: ???????????????? (glob) | |
122 | tip-rev: 5002 |
|
168 | tip-rev: 5002 |
General Comments 0
You need to be logged in to leave comments.
Login now