##// END OF EJS Templates
rust: Align DirstateEntry internals with Python/C DirstateItem...
Simon Sapin -
r48856:008959fc default
parent child Browse files
Show More
@@ -1,1080 +1,1080 b''
1 # This file is automatically @generated by Cargo.
1 # This file is automatically @generated by Cargo.
2 # It is not intended for manual editing.
2 # It is not intended for manual editing.
3
4 [[package]]
3 [[package]]
5 name = "adler"
4 name = "adler"
6 version = "0.2.3"
5 version = "0.2.3"
7 source = "registry+https://github.com/rust-lang/crates.io-index"
6 source = "registry+https://github.com/rust-lang/crates.io-index"
8 checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
7 checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
9
8
10 [[package]]
9 [[package]]
11 name = "aho-corasick"
10 name = "aho-corasick"
12 version = "0.7.15"
11 version = "0.7.15"
13 source = "registry+https://github.com/rust-lang/crates.io-index"
12 source = "registry+https://github.com/rust-lang/crates.io-index"
14 checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5"
13 checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5"
15 dependencies = [
14 dependencies = [
16 "memchr",
15 "memchr",
17 ]
16 ]
18
17
19 [[package]]
18 [[package]]
20 name = "ansi_term"
19 name = "ansi_term"
21 version = "0.11.0"
20 version = "0.11.0"
22 source = "registry+https://github.com/rust-lang/crates.io-index"
21 source = "registry+https://github.com/rust-lang/crates.io-index"
23 checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
22 checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
24 dependencies = [
23 dependencies = [
25 "winapi",
24 "winapi",
26 ]
25 ]
27
26
28 [[package]]
27 [[package]]
29 name = "atty"
28 name = "atty"
30 version = "0.2.14"
29 version = "0.2.14"
31 source = "registry+https://github.com/rust-lang/crates.io-index"
30 source = "registry+https://github.com/rust-lang/crates.io-index"
32 checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
31 checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
33 dependencies = [
32 dependencies = [
34 "hermit-abi",
33 "hermit-abi",
35 "libc",
34 "libc",
36 "winapi",
35 "winapi",
37 ]
36 ]
38
37
39 [[package]]
38 [[package]]
40 name = "autocfg"
39 name = "autocfg"
41 version = "1.0.1"
40 version = "1.0.1"
42 source = "registry+https://github.com/rust-lang/crates.io-index"
41 source = "registry+https://github.com/rust-lang/crates.io-index"
43 checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
42 checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
44
43
45 [[package]]
44 [[package]]
46 name = "bitflags"
45 name = "bitflags"
47 version = "1.2.1"
46 version = "1.2.1"
48 source = "registry+https://github.com/rust-lang/crates.io-index"
47 source = "registry+https://github.com/rust-lang/crates.io-index"
49 checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
48 checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
50
49
51 [[package]]
50 [[package]]
52 name = "bitmaps"
51 name = "bitmaps"
53 version = "2.1.0"
52 version = "2.1.0"
54 source = "registry+https://github.com/rust-lang/crates.io-index"
53 source = "registry+https://github.com/rust-lang/crates.io-index"
55 checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2"
54 checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2"
56 dependencies = [
55 dependencies = [
57 "typenum",
56 "typenum",
58 ]
57 ]
59
58
60 [[package]]
59 [[package]]
61 name = "block-buffer"
60 name = "block-buffer"
62 version = "0.9.0"
61 version = "0.9.0"
63 source = "registry+https://github.com/rust-lang/crates.io-index"
62 source = "registry+https://github.com/rust-lang/crates.io-index"
64 checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
63 checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
65 dependencies = [
64 dependencies = [
66 "generic-array",
65 "generic-array",
67 ]
66 ]
68
67
69 [[package]]
68 [[package]]
70 name = "byteorder"
69 name = "byteorder"
71 version = "1.3.4"
70 version = "1.3.4"
72 source = "registry+https://github.com/rust-lang/crates.io-index"
71 source = "registry+https://github.com/rust-lang/crates.io-index"
73 checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
72 checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
74
73
75 [[package]]
74 [[package]]
76 name = "bytes-cast"
75 name = "bytes-cast"
77 version = "0.2.0"
76 version = "0.2.0"
78 source = "registry+https://github.com/rust-lang/crates.io-index"
77 source = "registry+https://github.com/rust-lang/crates.io-index"
79 checksum = "0d434f9a4ecbe987e7ccfda7274b6f82ea52c9b63742565a65cb5e8ba0f2c452"
78 checksum = "0d434f9a4ecbe987e7ccfda7274b6f82ea52c9b63742565a65cb5e8ba0f2c452"
80 dependencies = [
79 dependencies = [
81 "bytes-cast-derive",
80 "bytes-cast-derive",
82 ]
81 ]
83
82
84 [[package]]
83 [[package]]
85 name = "bytes-cast-derive"
84 name = "bytes-cast-derive"
86 version = "0.1.0"
85 version = "0.1.0"
87 source = "registry+https://github.com/rust-lang/crates.io-index"
86 source = "registry+https://github.com/rust-lang/crates.io-index"
88 checksum = "cb936af9de38476664d6b58e529aff30d482e4ce1c5e150293d00730b0d81fdb"
87 checksum = "cb936af9de38476664d6b58e529aff30d482e4ce1c5e150293d00730b0d81fdb"
89 dependencies = [
88 dependencies = [
90 "proc-macro2",
89 "proc-macro2",
91 "quote",
90 "quote",
92 "syn",
91 "syn",
93 ]
92 ]
94
93
95 [[package]]
94 [[package]]
96 name = "cc"
95 name = "cc"
97 version = "1.0.66"
96 version = "1.0.66"
98 source = "registry+https://github.com/rust-lang/crates.io-index"
97 source = "registry+https://github.com/rust-lang/crates.io-index"
99 checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48"
98 checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48"
100 dependencies = [
99 dependencies = [
101 "jobserver",
100 "jobserver",
102 ]
101 ]
103
102
104 [[package]]
103 [[package]]
105 name = "cfg-if"
104 name = "cfg-if"
106 version = "0.1.10"
105 version = "0.1.10"
107 source = "registry+https://github.com/rust-lang/crates.io-index"
106 source = "registry+https://github.com/rust-lang/crates.io-index"
108 checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
107 checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
109
108
110 [[package]]
109 [[package]]
111 name = "cfg-if"
110 name = "cfg-if"
112 version = "1.0.0"
111 version = "1.0.0"
113 source = "registry+https://github.com/rust-lang/crates.io-index"
112 source = "registry+https://github.com/rust-lang/crates.io-index"
114 checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
113 checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
115
114
116 [[package]]
115 [[package]]
117 name = "chrono"
116 name = "chrono"
118 version = "0.4.19"
117 version = "0.4.19"
119 source = "registry+https://github.com/rust-lang/crates.io-index"
118 source = "registry+https://github.com/rust-lang/crates.io-index"
120 checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
119 checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
121 dependencies = [
120 dependencies = [
122 "libc",
121 "libc",
123 "num-integer",
122 "num-integer",
124 "num-traits",
123 "num-traits",
125 "time",
124 "time",
126 "winapi",
125 "winapi",
127 ]
126 ]
128
127
129 [[package]]
128 [[package]]
130 name = "clap"
129 name = "clap"
131 version = "2.33.3"
130 version = "2.33.3"
132 source = "registry+https://github.com/rust-lang/crates.io-index"
131 source = "registry+https://github.com/rust-lang/crates.io-index"
133 checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
132 checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
134 dependencies = [
133 dependencies = [
135 "ansi_term",
134 "ansi_term",
136 "atty",
135 "atty",
137 "bitflags",
136 "bitflags",
138 "strsim",
137 "strsim",
139 "textwrap",
138 "textwrap",
140 "unicode-width",
139 "unicode-width",
141 "vec_map",
140 "vec_map",
142 ]
141 ]
143
142
144 [[package]]
143 [[package]]
145 name = "const_fn"
144 name = "const_fn"
146 version = "0.4.4"
145 version = "0.4.4"
147 source = "registry+https://github.com/rust-lang/crates.io-index"
146 source = "registry+https://github.com/rust-lang/crates.io-index"
148 checksum = "cd51eab21ab4fd6a3bf889e2d0958c0a6e3a61ad04260325e919e652a2a62826"
147 checksum = "cd51eab21ab4fd6a3bf889e2d0958c0a6e3a61ad04260325e919e652a2a62826"
149
148
150 [[package]]
149 [[package]]
151 name = "cpufeatures"
150 name = "cpufeatures"
152 version = "0.1.4"
151 version = "0.1.4"
153 source = "registry+https://github.com/rust-lang/crates.io-index"
152 source = "registry+https://github.com/rust-lang/crates.io-index"
154 checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8"
153 checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8"
155 dependencies = [
154 dependencies = [
156 "libc",
155 "libc",
157 ]
156 ]
158
157
159 [[package]]
158 [[package]]
160 name = "cpython"
159 name = "cpython"
161 version = "0.6.0"
160 version = "0.6.0"
162 source = "registry+https://github.com/rust-lang/crates.io-index"
161 source = "registry+https://github.com/rust-lang/crates.io-index"
163 checksum = "8094679a4e9bfc8035572162624bc800eda35b5f9eff2537b9cd9aacc3d9782e"
162 checksum = "8094679a4e9bfc8035572162624bc800eda35b5f9eff2537b9cd9aacc3d9782e"
164 dependencies = [
163 dependencies = [
165 "libc",
164 "libc",
166 "num-traits",
165 "num-traits",
167 "paste",
166 "paste",
168 "python27-sys",
167 "python27-sys",
169 "python3-sys",
168 "python3-sys",
170 ]
169 ]
171
170
172 [[package]]
171 [[package]]
173 name = "crc32fast"
172 name = "crc32fast"
174 version = "1.2.1"
173 version = "1.2.1"
175 source = "registry+https://github.com/rust-lang/crates.io-index"
174 source = "registry+https://github.com/rust-lang/crates.io-index"
176 checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a"
175 checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a"
177 dependencies = [
176 dependencies = [
178 "cfg-if 1.0.0",
177 "cfg-if 1.0.0",
179 ]
178 ]
180
179
181 [[package]]
180 [[package]]
182 name = "crossbeam-channel"
181 name = "crossbeam-channel"
183 version = "0.4.4"
182 version = "0.4.4"
184 source = "registry+https://github.com/rust-lang/crates.io-index"
183 source = "registry+https://github.com/rust-lang/crates.io-index"
185 checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87"
184 checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87"
186 dependencies = [
185 dependencies = [
187 "crossbeam-utils 0.7.2",
186 "crossbeam-utils 0.7.2",
188 "maybe-uninit",
187 "maybe-uninit",
189 ]
188 ]
190
189
191 [[package]]
190 [[package]]
192 name = "crossbeam-channel"
191 name = "crossbeam-channel"
193 version = "0.5.0"
192 version = "0.5.0"
194 source = "registry+https://github.com/rust-lang/crates.io-index"
193 source = "registry+https://github.com/rust-lang/crates.io-index"
195 checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775"
194 checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775"
196 dependencies = [
195 dependencies = [
197 "cfg-if 1.0.0",
196 "cfg-if 1.0.0",
198 "crossbeam-utils 0.8.1",
197 "crossbeam-utils 0.8.1",
199 ]
198 ]
200
199
201 [[package]]
200 [[package]]
202 name = "crossbeam-deque"
201 name = "crossbeam-deque"
203 version = "0.8.0"
202 version = "0.8.0"
204 source = "registry+https://github.com/rust-lang/crates.io-index"
203 source = "registry+https://github.com/rust-lang/crates.io-index"
205 checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9"
204 checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9"
206 dependencies = [
205 dependencies = [
207 "cfg-if 1.0.0",
206 "cfg-if 1.0.0",
208 "crossbeam-epoch",
207 "crossbeam-epoch",
209 "crossbeam-utils 0.8.1",
208 "crossbeam-utils 0.8.1",
210 ]
209 ]
211
210
212 [[package]]
211 [[package]]
213 name = "crossbeam-epoch"
212 name = "crossbeam-epoch"
214 version = "0.9.1"
213 version = "0.9.1"
215 source = "registry+https://github.com/rust-lang/crates.io-index"
214 source = "registry+https://github.com/rust-lang/crates.io-index"
216 checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d"
215 checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d"
217 dependencies = [
216 dependencies = [
218 "cfg-if 1.0.0",
217 "cfg-if 1.0.0",
219 "const_fn",
218 "const_fn",
220 "crossbeam-utils 0.8.1",
219 "crossbeam-utils 0.8.1",
221 "lazy_static",
220 "lazy_static",
222 "memoffset",
221 "memoffset",
223 "scopeguard",
222 "scopeguard",
224 ]
223 ]
225
224
226 [[package]]
225 [[package]]
227 name = "crossbeam-utils"
226 name = "crossbeam-utils"
228 version = "0.7.2"
227 version = "0.7.2"
229 source = "registry+https://github.com/rust-lang/crates.io-index"
228 source = "registry+https://github.com/rust-lang/crates.io-index"
230 checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
229 checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
231 dependencies = [
230 dependencies = [
232 "autocfg",
231 "autocfg",
233 "cfg-if 0.1.10",
232 "cfg-if 0.1.10",
234 "lazy_static",
233 "lazy_static",
235 ]
234 ]
236
235
237 [[package]]
236 [[package]]
238 name = "crossbeam-utils"
237 name = "crossbeam-utils"
239 version = "0.8.1"
238 version = "0.8.1"
240 source = "registry+https://github.com/rust-lang/crates.io-index"
239 source = "registry+https://github.com/rust-lang/crates.io-index"
241 checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d"
240 checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d"
242 dependencies = [
241 dependencies = [
243 "autocfg",
242 "autocfg",
244 "cfg-if 1.0.0",
243 "cfg-if 1.0.0",
245 "lazy_static",
244 "lazy_static",
246 ]
245 ]
247
246
248 [[package]]
247 [[package]]
249 name = "ctor"
248 name = "ctor"
250 version = "0.1.16"
249 version = "0.1.16"
251 source = "registry+https://github.com/rust-lang/crates.io-index"
250 source = "registry+https://github.com/rust-lang/crates.io-index"
252 checksum = "7fbaabec2c953050352311293be5c6aba8e141ba19d6811862b232d6fd020484"
251 checksum = "7fbaabec2c953050352311293be5c6aba8e141ba19d6811862b232d6fd020484"
253 dependencies = [
252 dependencies = [
254 "quote",
253 "quote",
255 "syn",
254 "syn",
256 ]
255 ]
257
256
258 [[package]]
257 [[package]]
259 name = "derive_more"
258 name = "derive_more"
260 version = "0.99.11"
259 version = "0.99.11"
261 source = "registry+https://github.com/rust-lang/crates.io-index"
260 source = "registry+https://github.com/rust-lang/crates.io-index"
262 checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c"
261 checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c"
263 dependencies = [
262 dependencies = [
264 "proc-macro2",
263 "proc-macro2",
265 "quote",
264 "quote",
266 "syn",
265 "syn",
267 ]
266 ]
268
267
269 [[package]]
268 [[package]]
270 name = "difference"
269 name = "difference"
271 version = "2.0.0"
270 version = "2.0.0"
272 source = "registry+https://github.com/rust-lang/crates.io-index"
271 source = "registry+https://github.com/rust-lang/crates.io-index"
273 checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
272 checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
274
273
275 [[package]]
274 [[package]]
276 name = "digest"
275 name = "digest"
277 version = "0.9.0"
276 version = "0.9.0"
278 source = "registry+https://github.com/rust-lang/crates.io-index"
277 source = "registry+https://github.com/rust-lang/crates.io-index"
279 checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
278 checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
280 dependencies = [
279 dependencies = [
281 "generic-array",
280 "generic-array",
282 ]
281 ]
283
282
284 [[package]]
283 [[package]]
285 name = "either"
284 name = "either"
286 version = "1.6.1"
285 version = "1.6.1"
287 source = "registry+https://github.com/rust-lang/crates.io-index"
286 source = "registry+https://github.com/rust-lang/crates.io-index"
288 checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
287 checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
289
288
290 [[package]]
289 [[package]]
291 name = "env_logger"
290 name = "env_logger"
292 version = "0.7.1"
291 version = "0.7.1"
293 source = "registry+https://github.com/rust-lang/crates.io-index"
292 source = "registry+https://github.com/rust-lang/crates.io-index"
294 checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
293 checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
295 dependencies = [
294 dependencies = [
296 "atty",
295 "atty",
297 "humantime",
296 "humantime",
298 "log",
297 "log",
299 "regex",
298 "regex",
300 "termcolor",
299 "termcolor",
301 ]
300 ]
302
301
303 [[package]]
302 [[package]]
304 name = "flate2"
303 name = "flate2"
305 version = "1.0.19"
304 version = "1.0.19"
306 source = "registry+https://github.com/rust-lang/crates.io-index"
305 source = "registry+https://github.com/rust-lang/crates.io-index"
307 checksum = "7411863d55df97a419aa64cb4d2f167103ea9d767e2c54a1868b7ac3f6b47129"
306 checksum = "7411863d55df97a419aa64cb4d2f167103ea9d767e2c54a1868b7ac3f6b47129"
308 dependencies = [
307 dependencies = [
309 "cfg-if 1.0.0",
308 "cfg-if 1.0.0",
310 "crc32fast",
309 "crc32fast",
311 "libc",
310 "libc",
312 "libz-sys",
311 "libz-sys",
313 "miniz_oxide",
312 "miniz_oxide",
314 ]
313 ]
315
314
316 [[package]]
315 [[package]]
317 name = "format-bytes"
316 name = "format-bytes"
318 version = "0.2.2"
317 version = "0.2.2"
319 source = "registry+https://github.com/rust-lang/crates.io-index"
318 source = "registry+https://github.com/rust-lang/crates.io-index"
320 checksum = "1c4e89040c7fd7b4e6ba2820ac705a45def8a0c098ec78d170ae88f1ef1d5762"
319 checksum = "1c4e89040c7fd7b4e6ba2820ac705a45def8a0c098ec78d170ae88f1ef1d5762"
321 dependencies = [
320 dependencies = [
322 "format-bytes-macros",
321 "format-bytes-macros",
323 "proc-macro-hack",
322 "proc-macro-hack",
324 ]
323 ]
325
324
326 [[package]]
325 [[package]]
327 name = "format-bytes-macros"
326 name = "format-bytes-macros"
328 version = "0.3.0"
327 version = "0.3.0"
329 source = "registry+https://github.com/rust-lang/crates.io-index"
328 source = "registry+https://github.com/rust-lang/crates.io-index"
330 checksum = "b05089e341a0460449e2210c3bf7b61597860b07f0deae58da38dbed0a4c6b6d"
329 checksum = "b05089e341a0460449e2210c3bf7b61597860b07f0deae58da38dbed0a4c6b6d"
331 dependencies = [
330 dependencies = [
332 "proc-macro-hack",
331 "proc-macro-hack",
333 "proc-macro2",
332 "proc-macro2",
334 "quote",
333 "quote",
335 "syn",
334 "syn",
336 ]
335 ]
337
336
338 [[package]]
337 [[package]]
339 name = "generic-array"
338 name = "generic-array"
340 version = "0.14.4"
339 version = "0.14.4"
341 source = "registry+https://github.com/rust-lang/crates.io-index"
340 source = "registry+https://github.com/rust-lang/crates.io-index"
342 checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
341 checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
343 dependencies = [
342 dependencies = [
344 "typenum",
343 "typenum",
345 "version_check",
344 "version_check",
346 ]
345 ]
347
346
348 [[package]]
347 [[package]]
349 name = "getrandom"
348 name = "getrandom"
350 version = "0.1.15"
349 version = "0.1.15"
351 source = "registry+https://github.com/rust-lang/crates.io-index"
350 source = "registry+https://github.com/rust-lang/crates.io-index"
352 checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
351 checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
353 dependencies = [
352 dependencies = [
354 "cfg-if 0.1.10",
353 "cfg-if 0.1.10",
355 "libc",
354 "libc",
356 "wasi 0.9.0+wasi-snapshot-preview1",
355 "wasi 0.9.0+wasi-snapshot-preview1",
357 ]
356 ]
358
357
359 [[package]]
358 [[package]]
360 name = "glob"
359 name = "glob"
361 version = "0.3.0"
360 version = "0.3.0"
362 source = "registry+https://github.com/rust-lang/crates.io-index"
361 source = "registry+https://github.com/rust-lang/crates.io-index"
363 checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
362 checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
364
363
365 [[package]]
364 [[package]]
366 name = "hermit-abi"
365 name = "hermit-abi"
367 version = "0.1.17"
366 version = "0.1.17"
368 source = "registry+https://github.com/rust-lang/crates.io-index"
367 source = "registry+https://github.com/rust-lang/crates.io-index"
369 checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"
368 checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"
370 dependencies = [
369 dependencies = [
371 "libc",
370 "libc",
372 ]
371 ]
373
372
374 [[package]]
373 [[package]]
375 name = "hg-core"
374 name = "hg-core"
376 version = "0.1.0"
375 version = "0.1.0"
377 dependencies = [
376 dependencies = [
377 "bitflags",
378 "byteorder",
378 "byteorder",
379 "bytes-cast",
379 "bytes-cast",
380 "clap",
380 "clap",
381 "crossbeam-channel 0.4.4",
381 "crossbeam-channel 0.4.4",
382 "derive_more",
382 "derive_more",
383 "flate2",
383 "flate2",
384 "format-bytes",
384 "format-bytes",
385 "home",
385 "home",
386 "im-rc",
386 "im-rc",
387 "itertools",
387 "itertools",
388 "lazy_static",
388 "lazy_static",
389 "log",
389 "log",
390 "memmap2",
390 "memmap2",
391 "micro-timer",
391 "micro-timer",
392 "pretty_assertions",
392 "pretty_assertions",
393 "rand",
393 "rand",
394 "rand_distr",
394 "rand_distr",
395 "rand_pcg",
395 "rand_pcg",
396 "rayon",
396 "rayon",
397 "regex",
397 "regex",
398 "same-file",
398 "same-file",
399 "sha-1",
399 "sha-1",
400 "stable_deref_trait",
400 "stable_deref_trait",
401 "tempfile",
401 "tempfile",
402 "twox-hash",
402 "twox-hash",
403 "zstd",
403 "zstd",
404 ]
404 ]
405
405
406 [[package]]
406 [[package]]
407 name = "hg-cpython"
407 name = "hg-cpython"
408 version = "0.1.0"
408 version = "0.1.0"
409 dependencies = [
409 dependencies = [
410 "cpython",
410 "cpython",
411 "crossbeam-channel 0.4.4",
411 "crossbeam-channel 0.4.4",
412 "env_logger",
412 "env_logger",
413 "hg-core",
413 "hg-core",
414 "libc",
414 "libc",
415 "log",
415 "log",
416 "stable_deref_trait",
416 "stable_deref_trait",
417 ]
417 ]
418
418
419 [[package]]
419 [[package]]
420 name = "home"
420 name = "home"
421 version = "0.5.3"
421 version = "0.5.3"
422 source = "registry+https://github.com/rust-lang/crates.io-index"
422 source = "registry+https://github.com/rust-lang/crates.io-index"
423 checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654"
423 checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654"
424 dependencies = [
424 dependencies = [
425 "winapi",
425 "winapi",
426 ]
426 ]
427
427
428 [[package]]
428 [[package]]
429 name = "humantime"
429 name = "humantime"
430 version = "1.3.0"
430 version = "1.3.0"
431 source = "registry+https://github.com/rust-lang/crates.io-index"
431 source = "registry+https://github.com/rust-lang/crates.io-index"
432 checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
432 checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
433 dependencies = [
433 dependencies = [
434 "quick-error",
434 "quick-error",
435 ]
435 ]
436
436
437 [[package]]
437 [[package]]
438 name = "im-rc"
438 name = "im-rc"
439 version = "15.0.0"
439 version = "15.0.0"
440 source = "registry+https://github.com/rust-lang/crates.io-index"
440 source = "registry+https://github.com/rust-lang/crates.io-index"
441 checksum = "3ca8957e71f04a205cb162508f9326aea04676c8dfd0711220190d6b83664f3f"
441 checksum = "3ca8957e71f04a205cb162508f9326aea04676c8dfd0711220190d6b83664f3f"
442 dependencies = [
442 dependencies = [
443 "bitmaps",
443 "bitmaps",
444 "rand_core",
444 "rand_core",
445 "rand_xoshiro",
445 "rand_xoshiro",
446 "sized-chunks",
446 "sized-chunks",
447 "typenum",
447 "typenum",
448 "version_check",
448 "version_check",
449 ]
449 ]
450
450
451 [[package]]
451 [[package]]
452 name = "itertools"
452 name = "itertools"
453 version = "0.9.0"
453 version = "0.9.0"
454 source = "registry+https://github.com/rust-lang/crates.io-index"
454 source = "registry+https://github.com/rust-lang/crates.io-index"
455 checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
455 checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
456 dependencies = [
456 dependencies = [
457 "either",
457 "either",
458 ]
458 ]
459
459
460 [[package]]
460 [[package]]
461 name = "jobserver"
461 name = "jobserver"
462 version = "0.1.21"
462 version = "0.1.21"
463 source = "registry+https://github.com/rust-lang/crates.io-index"
463 source = "registry+https://github.com/rust-lang/crates.io-index"
464 checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2"
464 checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2"
465 dependencies = [
465 dependencies = [
466 "libc",
466 "libc",
467 ]
467 ]
468
468
469 [[package]]
469 [[package]]
470 name = "lazy_static"
470 name = "lazy_static"
471 version = "1.4.0"
471 version = "1.4.0"
472 source = "registry+https://github.com/rust-lang/crates.io-index"
472 source = "registry+https://github.com/rust-lang/crates.io-index"
473 checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
473 checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
474
474
475 [[package]]
475 [[package]]
476 name = "libc"
476 name = "libc"
477 version = "0.2.81"
477 version = "0.2.81"
478 source = "registry+https://github.com/rust-lang/crates.io-index"
478 source = "registry+https://github.com/rust-lang/crates.io-index"
479 checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb"
479 checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb"
480
480
481 [[package]]
481 [[package]]
482 name = "libz-sys"
482 name = "libz-sys"
483 version = "1.1.2"
483 version = "1.1.2"
484 source = "registry+https://github.com/rust-lang/crates.io-index"
484 source = "registry+https://github.com/rust-lang/crates.io-index"
485 checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655"
485 checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655"
486 dependencies = [
486 dependencies = [
487 "cc",
487 "cc",
488 "pkg-config",
488 "pkg-config",
489 "vcpkg",
489 "vcpkg",
490 ]
490 ]
491
491
492 [[package]]
492 [[package]]
493 name = "log"
493 name = "log"
494 version = "0.4.11"
494 version = "0.4.11"
495 source = "registry+https://github.com/rust-lang/crates.io-index"
495 source = "registry+https://github.com/rust-lang/crates.io-index"
496 checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
496 checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
497 dependencies = [
497 dependencies = [
498 "cfg-if 0.1.10",
498 "cfg-if 0.1.10",
499 ]
499 ]
500
500
501 [[package]]
501 [[package]]
502 name = "maybe-uninit"
502 name = "maybe-uninit"
503 version = "2.0.0"
503 version = "2.0.0"
504 source = "registry+https://github.com/rust-lang/crates.io-index"
504 source = "registry+https://github.com/rust-lang/crates.io-index"
505 checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
505 checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
506
506
507 [[package]]
507 [[package]]
508 name = "memchr"
508 name = "memchr"
509 version = "2.3.4"
509 version = "2.3.4"
510 source = "registry+https://github.com/rust-lang/crates.io-index"
510 source = "registry+https://github.com/rust-lang/crates.io-index"
511 checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
511 checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
512
512
513 [[package]]
513 [[package]]
514 name = "memmap2"
514 name = "memmap2"
515 version = "0.4.0"
515 version = "0.4.0"
516 source = "registry+https://github.com/rust-lang/crates.io-index"
516 source = "registry+https://github.com/rust-lang/crates.io-index"
517 checksum = "de5d3112c080d58ce560081baeaab7e1e864ca21795ddbf533d5b1842bb1ecf8"
517 checksum = "de5d3112c080d58ce560081baeaab7e1e864ca21795ddbf533d5b1842bb1ecf8"
518 dependencies = [
518 dependencies = [
519 "libc",
519 "libc",
520 "stable_deref_trait",
520 "stable_deref_trait",
521 ]
521 ]
522
522
523 [[package]]
523 [[package]]
524 name = "memoffset"
524 name = "memoffset"
525 version = "0.6.1"
525 version = "0.6.1"
526 source = "registry+https://github.com/rust-lang/crates.io-index"
526 source = "registry+https://github.com/rust-lang/crates.io-index"
527 checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87"
527 checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87"
528 dependencies = [
528 dependencies = [
529 "autocfg",
529 "autocfg",
530 ]
530 ]
531
531
532 [[package]]
532 [[package]]
533 name = "micro-timer"
533 name = "micro-timer"
534 version = "0.3.1"
534 version = "0.3.1"
535 source = "registry+https://github.com/rust-lang/crates.io-index"
535 source = "registry+https://github.com/rust-lang/crates.io-index"
536 checksum = "2620153e1d903d26b72b89f0e9c48d8c4756cba941c185461dddc234980c298c"
536 checksum = "2620153e1d903d26b72b89f0e9c48d8c4756cba941c185461dddc234980c298c"
537 dependencies = [
537 dependencies = [
538 "micro-timer-macros",
538 "micro-timer-macros",
539 "scopeguard",
539 "scopeguard",
540 ]
540 ]
541
541
542 [[package]]
542 [[package]]
543 name = "micro-timer-macros"
543 name = "micro-timer-macros"
544 version = "0.3.1"
544 version = "0.3.1"
545 source = "registry+https://github.com/rust-lang/crates.io-index"
545 source = "registry+https://github.com/rust-lang/crates.io-index"
546 checksum = "e28a3473e6abd6e9aab36aaeef32ad22ae0bd34e79f376643594c2b152ec1c5d"
546 checksum = "e28a3473e6abd6e9aab36aaeef32ad22ae0bd34e79f376643594c2b152ec1c5d"
547 dependencies = [
547 dependencies = [
548 "proc-macro2",
548 "proc-macro2",
549 "quote",
549 "quote",
550 "scopeguard",
550 "scopeguard",
551 "syn",
551 "syn",
552 ]
552 ]
553
553
554 [[package]]
554 [[package]]
555 name = "miniz_oxide"
555 name = "miniz_oxide"
556 version = "0.4.3"
556 version = "0.4.3"
557 source = "registry+https://github.com/rust-lang/crates.io-index"
557 source = "registry+https://github.com/rust-lang/crates.io-index"
558 checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d"
558 checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d"
559 dependencies = [
559 dependencies = [
560 "adler",
560 "adler",
561 "autocfg",
561 "autocfg",
562 ]
562 ]
563
563
564 [[package]]
564 [[package]]
565 name = "num-integer"
565 name = "num-integer"
566 version = "0.1.44"
566 version = "0.1.44"
567 source = "registry+https://github.com/rust-lang/crates.io-index"
567 source = "registry+https://github.com/rust-lang/crates.io-index"
568 checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
568 checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
569 dependencies = [
569 dependencies = [
570 "autocfg",
570 "autocfg",
571 "num-traits",
571 "num-traits",
572 ]
572 ]
573
573
574 [[package]]
574 [[package]]
575 name = "num-traits"
575 name = "num-traits"
576 version = "0.2.14"
576 version = "0.2.14"
577 source = "registry+https://github.com/rust-lang/crates.io-index"
577 source = "registry+https://github.com/rust-lang/crates.io-index"
578 checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
578 checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
579 dependencies = [
579 dependencies = [
580 "autocfg",
580 "autocfg",
581 ]
581 ]
582
582
583 [[package]]
583 [[package]]
584 name = "num_cpus"
584 name = "num_cpus"
585 version = "1.13.0"
585 version = "1.13.0"
586 source = "registry+https://github.com/rust-lang/crates.io-index"
586 source = "registry+https://github.com/rust-lang/crates.io-index"
587 checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
587 checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
588 dependencies = [
588 dependencies = [
589 "hermit-abi",
589 "hermit-abi",
590 "libc",
590 "libc",
591 ]
591 ]
592
592
593 [[package]]
593 [[package]]
594 name = "opaque-debug"
594 name = "opaque-debug"
595 version = "0.3.0"
595 version = "0.3.0"
596 source = "registry+https://github.com/rust-lang/crates.io-index"
596 source = "registry+https://github.com/rust-lang/crates.io-index"
597 checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
597 checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
598
598
599 [[package]]
599 [[package]]
600 name = "output_vt100"
600 name = "output_vt100"
601 version = "0.1.2"
601 version = "0.1.2"
602 source = "registry+https://github.com/rust-lang/crates.io-index"
602 source = "registry+https://github.com/rust-lang/crates.io-index"
603 checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9"
603 checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9"
604 dependencies = [
604 dependencies = [
605 "winapi",
605 "winapi",
606 ]
606 ]
607
607
608 [[package]]
608 [[package]]
609 name = "paste"
609 name = "paste"
610 version = "1.0.5"
610 version = "1.0.5"
611 source = "registry+https://github.com/rust-lang/crates.io-index"
611 source = "registry+https://github.com/rust-lang/crates.io-index"
612 checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58"
612 checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58"
613
613
614 [[package]]
614 [[package]]
615 name = "pkg-config"
615 name = "pkg-config"
616 version = "0.3.19"
616 version = "0.3.19"
617 source = "registry+https://github.com/rust-lang/crates.io-index"
617 source = "registry+https://github.com/rust-lang/crates.io-index"
618 checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
618 checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
619
619
620 [[package]]
620 [[package]]
621 name = "ppv-lite86"
621 name = "ppv-lite86"
622 version = "0.2.10"
622 version = "0.2.10"
623 source = "registry+https://github.com/rust-lang/crates.io-index"
623 source = "registry+https://github.com/rust-lang/crates.io-index"
624 checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
624 checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
625
625
626 [[package]]
626 [[package]]
627 name = "pretty_assertions"
627 name = "pretty_assertions"
628 version = "0.6.1"
628 version = "0.6.1"
629 source = "registry+https://github.com/rust-lang/crates.io-index"
629 source = "registry+https://github.com/rust-lang/crates.io-index"
630 checksum = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427"
630 checksum = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427"
631 dependencies = [
631 dependencies = [
632 "ansi_term",
632 "ansi_term",
633 "ctor",
633 "ctor",
634 "difference",
634 "difference",
635 "output_vt100",
635 "output_vt100",
636 ]
636 ]
637
637
638 [[package]]
638 [[package]]
639 name = "proc-macro-hack"
639 name = "proc-macro-hack"
640 version = "0.5.19"
640 version = "0.5.19"
641 source = "registry+https://github.com/rust-lang/crates.io-index"
641 source = "registry+https://github.com/rust-lang/crates.io-index"
642 checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
642 checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
643
643
644 [[package]]
644 [[package]]
645 name = "proc-macro2"
645 name = "proc-macro2"
646 version = "1.0.24"
646 version = "1.0.24"
647 source = "registry+https://github.com/rust-lang/crates.io-index"
647 source = "registry+https://github.com/rust-lang/crates.io-index"
648 checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
648 checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
649 dependencies = [
649 dependencies = [
650 "unicode-xid",
650 "unicode-xid",
651 ]
651 ]
652
652
653 [[package]]
653 [[package]]
654 name = "python27-sys"
654 name = "python27-sys"
655 version = "0.6.0"
655 version = "0.6.0"
656 source = "registry+https://github.com/rust-lang/crates.io-index"
656 source = "registry+https://github.com/rust-lang/crates.io-index"
657 checksum = "5826ddbc5366eb0b0492040fdc25bf50bb49092c192bd45e80fb7a24dc6832ab"
657 checksum = "5826ddbc5366eb0b0492040fdc25bf50bb49092c192bd45e80fb7a24dc6832ab"
658 dependencies = [
658 dependencies = [
659 "libc",
659 "libc",
660 "regex",
660 "regex",
661 ]
661 ]
662
662
663 [[package]]
663 [[package]]
664 name = "python3-sys"
664 name = "python3-sys"
665 version = "0.6.0"
665 version = "0.6.0"
666 source = "registry+https://github.com/rust-lang/crates.io-index"
666 source = "registry+https://github.com/rust-lang/crates.io-index"
667 checksum = "b78af21b29594951a47fc3dac9b9eff0a3f077dec2f780ee943ae16a668f3b6a"
667 checksum = "b78af21b29594951a47fc3dac9b9eff0a3f077dec2f780ee943ae16a668f3b6a"
668 dependencies = [
668 dependencies = [
669 "libc",
669 "libc",
670 "regex",
670 "regex",
671 ]
671 ]
672
672
673 [[package]]
673 [[package]]
674 name = "quick-error"
674 name = "quick-error"
675 version = "1.2.3"
675 version = "1.2.3"
676 source = "registry+https://github.com/rust-lang/crates.io-index"
676 source = "registry+https://github.com/rust-lang/crates.io-index"
677 checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
677 checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
678
678
679 [[package]]
679 [[package]]
680 name = "quote"
680 name = "quote"
681 version = "1.0.7"
681 version = "1.0.7"
682 source = "registry+https://github.com/rust-lang/crates.io-index"
682 source = "registry+https://github.com/rust-lang/crates.io-index"
683 checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
683 checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
684 dependencies = [
684 dependencies = [
685 "proc-macro2",
685 "proc-macro2",
686 ]
686 ]
687
687
688 [[package]]
688 [[package]]
689 name = "rand"
689 name = "rand"
690 version = "0.7.3"
690 version = "0.7.3"
691 source = "registry+https://github.com/rust-lang/crates.io-index"
691 source = "registry+https://github.com/rust-lang/crates.io-index"
692 checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
692 checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
693 dependencies = [
693 dependencies = [
694 "getrandom",
694 "getrandom",
695 "libc",
695 "libc",
696 "rand_chacha",
696 "rand_chacha",
697 "rand_core",
697 "rand_core",
698 "rand_hc",
698 "rand_hc",
699 ]
699 ]
700
700
701 [[package]]
701 [[package]]
702 name = "rand_chacha"
702 name = "rand_chacha"
703 version = "0.2.2"
703 version = "0.2.2"
704 source = "registry+https://github.com/rust-lang/crates.io-index"
704 source = "registry+https://github.com/rust-lang/crates.io-index"
705 checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
705 checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
706 dependencies = [
706 dependencies = [
707 "ppv-lite86",
707 "ppv-lite86",
708 "rand_core",
708 "rand_core",
709 ]
709 ]
710
710
711 [[package]]
711 [[package]]
712 name = "rand_core"
712 name = "rand_core"
713 version = "0.5.1"
713 version = "0.5.1"
714 source = "registry+https://github.com/rust-lang/crates.io-index"
714 source = "registry+https://github.com/rust-lang/crates.io-index"
715 checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
715 checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
716 dependencies = [
716 dependencies = [
717 "getrandom",
717 "getrandom",
718 ]
718 ]
719
719
720 [[package]]
720 [[package]]
721 name = "rand_distr"
721 name = "rand_distr"
722 version = "0.2.2"
722 version = "0.2.2"
723 source = "registry+https://github.com/rust-lang/crates.io-index"
723 source = "registry+https://github.com/rust-lang/crates.io-index"
724 checksum = "96977acbdd3a6576fb1d27391900035bf3863d4a16422973a409b488cf29ffb2"
724 checksum = "96977acbdd3a6576fb1d27391900035bf3863d4a16422973a409b488cf29ffb2"
725 dependencies = [
725 dependencies = [
726 "rand",
726 "rand",
727 ]
727 ]
728
728
729 [[package]]
729 [[package]]
730 name = "rand_hc"
730 name = "rand_hc"
731 version = "0.2.0"
731 version = "0.2.0"
732 source = "registry+https://github.com/rust-lang/crates.io-index"
732 source = "registry+https://github.com/rust-lang/crates.io-index"
733 checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
733 checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
734 dependencies = [
734 dependencies = [
735 "rand_core",
735 "rand_core",
736 ]
736 ]
737
737
738 [[package]]
738 [[package]]
739 name = "rand_pcg"
739 name = "rand_pcg"
740 version = "0.2.1"
740 version = "0.2.1"
741 source = "registry+https://github.com/rust-lang/crates.io-index"
741 source = "registry+https://github.com/rust-lang/crates.io-index"
742 checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429"
742 checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429"
743 dependencies = [
743 dependencies = [
744 "rand_core",
744 "rand_core",
745 ]
745 ]
746
746
747 [[package]]
747 [[package]]
748 name = "rand_xoshiro"
748 name = "rand_xoshiro"
749 version = "0.4.0"
749 version = "0.4.0"
750 source = "registry+https://github.com/rust-lang/crates.io-index"
750 source = "registry+https://github.com/rust-lang/crates.io-index"
751 checksum = "a9fcdd2e881d02f1d9390ae47ad8e5696a9e4be7b547a1da2afbc61973217004"
751 checksum = "a9fcdd2e881d02f1d9390ae47ad8e5696a9e4be7b547a1da2afbc61973217004"
752 dependencies = [
752 dependencies = [
753 "rand_core",
753 "rand_core",
754 ]
754 ]
755
755
756 [[package]]
756 [[package]]
757 name = "rayon"
757 name = "rayon"
758 version = "1.5.0"
758 version = "1.5.0"
759 source = "registry+https://github.com/rust-lang/crates.io-index"
759 source = "registry+https://github.com/rust-lang/crates.io-index"
760 checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674"
760 checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674"
761 dependencies = [
761 dependencies = [
762 "autocfg",
762 "autocfg",
763 "crossbeam-deque",
763 "crossbeam-deque",
764 "either",
764 "either",
765 "rayon-core",
765 "rayon-core",
766 ]
766 ]
767
767
768 [[package]]
768 [[package]]
769 name = "rayon-core"
769 name = "rayon-core"
770 version = "1.9.0"
770 version = "1.9.0"
771 source = "registry+https://github.com/rust-lang/crates.io-index"
771 source = "registry+https://github.com/rust-lang/crates.io-index"
772 checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a"
772 checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a"
773 dependencies = [
773 dependencies = [
774 "crossbeam-channel 0.5.0",
774 "crossbeam-channel 0.5.0",
775 "crossbeam-deque",
775 "crossbeam-deque",
776 "crossbeam-utils 0.8.1",
776 "crossbeam-utils 0.8.1",
777 "lazy_static",
777 "lazy_static",
778 "num_cpus",
778 "num_cpus",
779 ]
779 ]
780
780
781 [[package]]
781 [[package]]
782 name = "redox_syscall"
782 name = "redox_syscall"
783 version = "0.1.57"
783 version = "0.1.57"
784 source = "registry+https://github.com/rust-lang/crates.io-index"
784 source = "registry+https://github.com/rust-lang/crates.io-index"
785 checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
785 checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
786
786
787 [[package]]
787 [[package]]
788 name = "regex"
788 name = "regex"
789 version = "1.4.2"
789 version = "1.4.2"
790 source = "registry+https://github.com/rust-lang/crates.io-index"
790 source = "registry+https://github.com/rust-lang/crates.io-index"
791 checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c"
791 checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c"
792 dependencies = [
792 dependencies = [
793 "aho-corasick",
793 "aho-corasick",
794 "memchr",
794 "memchr",
795 "regex-syntax",
795 "regex-syntax",
796 "thread_local",
796 "thread_local",
797 ]
797 ]
798
798
799 [[package]]
799 [[package]]
800 name = "regex-syntax"
800 name = "regex-syntax"
801 version = "0.6.21"
801 version = "0.6.21"
802 source = "registry+https://github.com/rust-lang/crates.io-index"
802 source = "registry+https://github.com/rust-lang/crates.io-index"
803 checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189"
803 checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189"
804
804
805 [[package]]
805 [[package]]
806 name = "remove_dir_all"
806 name = "remove_dir_all"
807 version = "0.5.3"
807 version = "0.5.3"
808 source = "registry+https://github.com/rust-lang/crates.io-index"
808 source = "registry+https://github.com/rust-lang/crates.io-index"
809 checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
809 checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
810 dependencies = [
810 dependencies = [
811 "winapi",
811 "winapi",
812 ]
812 ]
813
813
814 [[package]]
814 [[package]]
815 name = "rhg"
815 name = "rhg"
816 version = "0.1.0"
816 version = "0.1.0"
817 dependencies = [
817 dependencies = [
818 "chrono",
818 "chrono",
819 "clap",
819 "clap",
820 "derive_more",
820 "derive_more",
821 "env_logger",
821 "env_logger",
822 "format-bytes",
822 "format-bytes",
823 "hg-core",
823 "hg-core",
824 "home",
824 "home",
825 "lazy_static",
825 "lazy_static",
826 "log",
826 "log",
827 "micro-timer",
827 "micro-timer",
828 "regex",
828 "regex",
829 "users",
829 "users",
830 ]
830 ]
831
831
832 [[package]]
832 [[package]]
833 name = "same-file"
833 name = "same-file"
834 version = "1.0.6"
834 version = "1.0.6"
835 source = "registry+https://github.com/rust-lang/crates.io-index"
835 source = "registry+https://github.com/rust-lang/crates.io-index"
836 checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
836 checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
837 dependencies = [
837 dependencies = [
838 "winapi-util",
838 "winapi-util",
839 ]
839 ]
840
840
841 [[package]]
841 [[package]]
842 name = "scopeguard"
842 name = "scopeguard"
843 version = "1.1.0"
843 version = "1.1.0"
844 source = "registry+https://github.com/rust-lang/crates.io-index"
844 source = "registry+https://github.com/rust-lang/crates.io-index"
845 checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
845 checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
846
846
847 [[package]]
847 [[package]]
848 name = "sha-1"
848 name = "sha-1"
849 version = "0.9.6"
849 version = "0.9.6"
850 source = "registry+https://github.com/rust-lang/crates.io-index"
850 source = "registry+https://github.com/rust-lang/crates.io-index"
851 checksum = "8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16"
851 checksum = "8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16"
852 dependencies = [
852 dependencies = [
853 "block-buffer",
853 "block-buffer",
854 "cfg-if 1.0.0",
854 "cfg-if 1.0.0",
855 "cpufeatures",
855 "cpufeatures",
856 "digest",
856 "digest",
857 "opaque-debug",
857 "opaque-debug",
858 ]
858 ]
859
859
860 [[package]]
860 [[package]]
861 name = "sized-chunks"
861 name = "sized-chunks"
862 version = "0.6.2"
862 version = "0.6.2"
863 source = "registry+https://github.com/rust-lang/crates.io-index"
863 source = "registry+https://github.com/rust-lang/crates.io-index"
864 checksum = "1ec31ceca5644fa6d444cc77548b88b67f46db6f7c71683b0f9336e671830d2f"
864 checksum = "1ec31ceca5644fa6d444cc77548b88b67f46db6f7c71683b0f9336e671830d2f"
865 dependencies = [
865 dependencies = [
866 "bitmaps",
866 "bitmaps",
867 "typenum",
867 "typenum",
868 ]
868 ]
869
869
870 [[package]]
870 [[package]]
871 name = "stable_deref_trait"
871 name = "stable_deref_trait"
872 version = "1.2.0"
872 version = "1.2.0"
873 source = "registry+https://github.com/rust-lang/crates.io-index"
873 source = "registry+https://github.com/rust-lang/crates.io-index"
874 checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
874 checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
875
875
876 [[package]]
876 [[package]]
877 name = "static_assertions"
877 name = "static_assertions"
878 version = "1.1.0"
878 version = "1.1.0"
879 source = "registry+https://github.com/rust-lang/crates.io-index"
879 source = "registry+https://github.com/rust-lang/crates.io-index"
880 checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
880 checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
881
881
882 [[package]]
882 [[package]]
883 name = "strsim"
883 name = "strsim"
884 version = "0.8.0"
884 version = "0.8.0"
885 source = "registry+https://github.com/rust-lang/crates.io-index"
885 source = "registry+https://github.com/rust-lang/crates.io-index"
886 checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
886 checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
887
887
888 [[package]]
888 [[package]]
889 name = "syn"
889 name = "syn"
890 version = "1.0.54"
890 version = "1.0.54"
891 source = "registry+https://github.com/rust-lang/crates.io-index"
891 source = "registry+https://github.com/rust-lang/crates.io-index"
892 checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44"
892 checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44"
893 dependencies = [
893 dependencies = [
894 "proc-macro2",
894 "proc-macro2",
895 "quote",
895 "quote",
896 "unicode-xid",
896 "unicode-xid",
897 ]
897 ]
898
898
899 [[package]]
899 [[package]]
900 name = "tempfile"
900 name = "tempfile"
901 version = "3.1.0"
901 version = "3.1.0"
902 source = "registry+https://github.com/rust-lang/crates.io-index"
902 source = "registry+https://github.com/rust-lang/crates.io-index"
903 checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9"
903 checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9"
904 dependencies = [
904 dependencies = [
905 "cfg-if 0.1.10",
905 "cfg-if 0.1.10",
906 "libc",
906 "libc",
907 "rand",
907 "rand",
908 "redox_syscall",
908 "redox_syscall",
909 "remove_dir_all",
909 "remove_dir_all",
910 "winapi",
910 "winapi",
911 ]
911 ]
912
912
913 [[package]]
913 [[package]]
914 name = "termcolor"
914 name = "termcolor"
915 version = "1.1.2"
915 version = "1.1.2"
916 source = "registry+https://github.com/rust-lang/crates.io-index"
916 source = "registry+https://github.com/rust-lang/crates.io-index"
917 checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
917 checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
918 dependencies = [
918 dependencies = [
919 "winapi-util",
919 "winapi-util",
920 ]
920 ]
921
921
922 [[package]]
922 [[package]]
923 name = "textwrap"
923 name = "textwrap"
924 version = "0.11.0"
924 version = "0.11.0"
925 source = "registry+https://github.com/rust-lang/crates.io-index"
925 source = "registry+https://github.com/rust-lang/crates.io-index"
926 checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
926 checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
927 dependencies = [
927 dependencies = [
928 "unicode-width",
928 "unicode-width",
929 ]
929 ]
930
930
931 [[package]]
931 [[package]]
932 name = "thread_local"
932 name = "thread_local"
933 version = "1.0.1"
933 version = "1.0.1"
934 source = "registry+https://github.com/rust-lang/crates.io-index"
934 source = "registry+https://github.com/rust-lang/crates.io-index"
935 checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
935 checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
936 dependencies = [
936 dependencies = [
937 "lazy_static",
937 "lazy_static",
938 ]
938 ]
939
939
940 [[package]]
940 [[package]]
941 name = "time"
941 name = "time"
942 version = "0.1.44"
942 version = "0.1.44"
943 source = "registry+https://github.com/rust-lang/crates.io-index"
943 source = "registry+https://github.com/rust-lang/crates.io-index"
944 checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
944 checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
945 dependencies = [
945 dependencies = [
946 "libc",
946 "libc",
947 "wasi 0.10.0+wasi-snapshot-preview1",
947 "wasi 0.10.0+wasi-snapshot-preview1",
948 "winapi",
948 "winapi",
949 ]
949 ]
950
950
951 [[package]]
951 [[package]]
952 name = "twox-hash"
952 name = "twox-hash"
953 version = "1.6.0"
953 version = "1.6.0"
954 source = "registry+https://github.com/rust-lang/crates.io-index"
954 source = "registry+https://github.com/rust-lang/crates.io-index"
955 checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59"
955 checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59"
956 dependencies = [
956 dependencies = [
957 "cfg-if 0.1.10",
957 "cfg-if 0.1.10",
958 "rand",
958 "rand",
959 "static_assertions",
959 "static_assertions",
960 ]
960 ]
961
961
962 [[package]]
962 [[package]]
963 name = "typenum"
963 name = "typenum"
964 version = "1.12.0"
964 version = "1.12.0"
965 source = "registry+https://github.com/rust-lang/crates.io-index"
965 source = "registry+https://github.com/rust-lang/crates.io-index"
966 checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"
966 checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"
967
967
968 [[package]]
968 [[package]]
969 name = "unicode-width"
969 name = "unicode-width"
970 version = "0.1.8"
970 version = "0.1.8"
971 source = "registry+https://github.com/rust-lang/crates.io-index"
971 source = "registry+https://github.com/rust-lang/crates.io-index"
972 checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
972 checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
973
973
974 [[package]]
974 [[package]]
975 name = "unicode-xid"
975 name = "unicode-xid"
976 version = "0.2.1"
976 version = "0.2.1"
977 source = "registry+https://github.com/rust-lang/crates.io-index"
977 source = "registry+https://github.com/rust-lang/crates.io-index"
978 checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
978 checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
979
979
980 [[package]]
980 [[package]]
981 name = "users"
981 name = "users"
982 version = "0.11.0"
982 version = "0.11.0"
983 source = "registry+https://github.com/rust-lang/crates.io-index"
983 source = "registry+https://github.com/rust-lang/crates.io-index"
984 checksum = "24cc0f6d6f267b73e5a2cadf007ba8f9bc39c6a6f9666f8cf25ea809a153b032"
984 checksum = "24cc0f6d6f267b73e5a2cadf007ba8f9bc39c6a6f9666f8cf25ea809a153b032"
985 dependencies = [
985 dependencies = [
986 "libc",
986 "libc",
987 "log",
987 "log",
988 ]
988 ]
989
989
990 [[package]]
990 [[package]]
991 name = "vcpkg"
991 name = "vcpkg"
992 version = "0.2.11"
992 version = "0.2.11"
993 source = "registry+https://github.com/rust-lang/crates.io-index"
993 source = "registry+https://github.com/rust-lang/crates.io-index"
994 checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb"
994 checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb"
995
995
996 [[package]]
996 [[package]]
997 name = "vec_map"
997 name = "vec_map"
998 version = "0.8.2"
998 version = "0.8.2"
999 source = "registry+https://github.com/rust-lang/crates.io-index"
999 source = "registry+https://github.com/rust-lang/crates.io-index"
1000 checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
1000 checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
1001
1001
1002 [[package]]
1002 [[package]]
1003 name = "version_check"
1003 name = "version_check"
1004 version = "0.9.2"
1004 version = "0.9.2"
1005 source = "registry+https://github.com/rust-lang/crates.io-index"
1005 source = "registry+https://github.com/rust-lang/crates.io-index"
1006 checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
1006 checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
1007
1007
1008 [[package]]
1008 [[package]]
1009 name = "wasi"
1009 name = "wasi"
1010 version = "0.9.0+wasi-snapshot-preview1"
1010 version = "0.9.0+wasi-snapshot-preview1"
1011 source = "registry+https://github.com/rust-lang/crates.io-index"
1011 source = "registry+https://github.com/rust-lang/crates.io-index"
1012 checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
1012 checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
1013
1013
1014 [[package]]
1014 [[package]]
1015 name = "wasi"
1015 name = "wasi"
1016 version = "0.10.0+wasi-snapshot-preview1"
1016 version = "0.10.0+wasi-snapshot-preview1"
1017 source = "registry+https://github.com/rust-lang/crates.io-index"
1017 source = "registry+https://github.com/rust-lang/crates.io-index"
1018 checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
1018 checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
1019
1019
1020 [[package]]
1020 [[package]]
1021 name = "winapi"
1021 name = "winapi"
1022 version = "0.3.9"
1022 version = "0.3.9"
1023 source = "registry+https://github.com/rust-lang/crates.io-index"
1023 source = "registry+https://github.com/rust-lang/crates.io-index"
1024 checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
1024 checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
1025 dependencies = [
1025 dependencies = [
1026 "winapi-i686-pc-windows-gnu",
1026 "winapi-i686-pc-windows-gnu",
1027 "winapi-x86_64-pc-windows-gnu",
1027 "winapi-x86_64-pc-windows-gnu",
1028 ]
1028 ]
1029
1029
1030 [[package]]
1030 [[package]]
1031 name = "winapi-i686-pc-windows-gnu"
1031 name = "winapi-i686-pc-windows-gnu"
1032 version = "0.4.0"
1032 version = "0.4.0"
1033 source = "registry+https://github.com/rust-lang/crates.io-index"
1033 source = "registry+https://github.com/rust-lang/crates.io-index"
1034 checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1034 checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1035
1035
1036 [[package]]
1036 [[package]]
1037 name = "winapi-util"
1037 name = "winapi-util"
1038 version = "0.1.5"
1038 version = "0.1.5"
1039 source = "registry+https://github.com/rust-lang/crates.io-index"
1039 source = "registry+https://github.com/rust-lang/crates.io-index"
1040 checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
1040 checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
1041 dependencies = [
1041 dependencies = [
1042 "winapi",
1042 "winapi",
1043 ]
1043 ]
1044
1044
1045 [[package]]
1045 [[package]]
1046 name = "winapi-x86_64-pc-windows-gnu"
1046 name = "winapi-x86_64-pc-windows-gnu"
1047 version = "0.4.0"
1047 version = "0.4.0"
1048 source = "registry+https://github.com/rust-lang/crates.io-index"
1048 source = "registry+https://github.com/rust-lang/crates.io-index"
1049 checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1049 checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1050
1050
1051 [[package]]
1051 [[package]]
1052 name = "zstd"
1052 name = "zstd"
1053 version = "0.5.3+zstd.1.4.5"
1053 version = "0.5.3+zstd.1.4.5"
1054 source = "registry+https://github.com/rust-lang/crates.io-index"
1054 source = "registry+https://github.com/rust-lang/crates.io-index"
1055 checksum = "01b32eaf771efa709e8308605bbf9319bf485dc1503179ec0469b611937c0cd8"
1055 checksum = "01b32eaf771efa709e8308605bbf9319bf485dc1503179ec0469b611937c0cd8"
1056 dependencies = [
1056 dependencies = [
1057 "zstd-safe",
1057 "zstd-safe",
1058 ]
1058 ]
1059
1059
1060 [[package]]
1060 [[package]]
1061 name = "zstd-safe"
1061 name = "zstd-safe"
1062 version = "2.0.5+zstd.1.4.5"
1062 version = "2.0.5+zstd.1.4.5"
1063 source = "registry+https://github.com/rust-lang/crates.io-index"
1063 source = "registry+https://github.com/rust-lang/crates.io-index"
1064 checksum = "1cfb642e0d27f64729a639c52db457e0ae906e7bc6f5fe8f5c453230400f1055"
1064 checksum = "1cfb642e0d27f64729a639c52db457e0ae906e7bc6f5fe8f5c453230400f1055"
1065 dependencies = [
1065 dependencies = [
1066 "libc",
1066 "libc",
1067 "zstd-sys",
1067 "zstd-sys",
1068 ]
1068 ]
1069
1069
1070 [[package]]
1070 [[package]]
1071 name = "zstd-sys"
1071 name = "zstd-sys"
1072 version = "1.4.17+zstd.1.4.5"
1072 version = "1.4.17+zstd.1.4.5"
1073 source = "registry+https://github.com/rust-lang/crates.io-index"
1073 source = "registry+https://github.com/rust-lang/crates.io-index"
1074 checksum = "b89249644df056b522696b1bb9e7c18c87e8ffa3e2f0dc3b0155875d6498f01b"
1074 checksum = "b89249644df056b522696b1bb9e7c18c87e8ffa3e2f0dc3b0155875d6498f01b"
1075 dependencies = [
1075 dependencies = [
1076 "cc",
1076 "cc",
1077 "glob",
1077 "glob",
1078 "itertools",
1078 "itertools",
1079 "libc",
1079 "libc",
1080 ]
1080 ]
@@ -1,45 +1,46 b''
1 [package]
1 [package]
2 name = "hg-core"
2 name = "hg-core"
3 version = "0.1.0"
3 version = "0.1.0"
4 authors = ["Georges Racinet <gracinet@anybox.fr>"]
4 authors = ["Georges Racinet <gracinet@anybox.fr>"]
5 description = "Mercurial pure Rust core library, with no assumption on Python bindings (FFI)"
5 description = "Mercurial pure Rust core library, with no assumption on Python bindings (FFI)"
6 edition = "2018"
6 edition = "2018"
7
7
8 [lib]
8 [lib]
9 name = "hg"
9 name = "hg"
10
10
11 [dependencies]
11 [dependencies]
12 bitflags = "1.2"
12 bytes-cast = "0.2"
13 bytes-cast = "0.2"
13 byteorder = "1.3.4"
14 byteorder = "1.3.4"
14 derive_more = "0.99"
15 derive_more = "0.99"
15 home = "0.5"
16 home = "0.5"
16 im-rc = "15.0.*"
17 im-rc = "15.0.*"
17 itertools = "0.9"
18 itertools = "0.9"
18 lazy_static = "1.4.0"
19 lazy_static = "1.4.0"
19 rand = "0.7.3"
20 rand = "0.7.3"
20 rand_pcg = "0.2.1"
21 rand_pcg = "0.2.1"
21 rand_distr = "0.2.2"
22 rand_distr = "0.2.2"
22 rayon = "1.3.0"
23 rayon = "1.3.0"
23 regex = "1.3.9"
24 regex = "1.3.9"
24 sha-1 = "0.9.6"
25 sha-1 = "0.9.6"
25 twox-hash = "1.5.0"
26 twox-hash = "1.5.0"
26 same-file = "1.0.6"
27 same-file = "1.0.6"
27 stable_deref_trait = "1.2.0"
28 stable_deref_trait = "1.2.0"
28 tempfile = "3.1.0"
29 tempfile = "3.1.0"
29 crossbeam-channel = "0.4"
30 crossbeam-channel = "0.4"
30 micro-timer = "0.3.0"
31 micro-timer = "0.3.0"
31 log = "0.4.8"
32 log = "0.4.8"
32 memmap2 = {version = "0.4", features = ["stable_deref_trait"]}
33 memmap2 = {version = "0.4", features = ["stable_deref_trait"]}
33 zstd = "0.5.3"
34 zstd = "0.5.3"
34 format-bytes = "0.2.2"
35 format-bytes = "0.2.2"
35
36
36 # We don't use the `miniz-oxide` backend to not change rhg benchmarks and until
37 # We don't use the `miniz-oxide` backend to not change rhg benchmarks and until
37 # we have a clearer view of which backend is the fastest.
38 # we have a clearer view of which backend is the fastest.
38 [dependencies.flate2]
39 [dependencies.flate2]
39 version = "1.0.16"
40 version = "1.0.16"
40 features = ["zlib"]
41 features = ["zlib"]
41 default-features = false
42 default-features = false
42
43
43 [dev-dependencies]
44 [dev-dependencies]
44 clap = "*"
45 clap = "*"
45 pretty_assertions = "0.6.1"
46 pretty_assertions = "0.6.1"
@@ -1,470 +1,471 b''
1 // dirstate_map.rs
1 // dirstate_map.rs
2 //
2 //
3 // Copyright 2019 Raphaël Gomès <rgomes@octobus.net>
3 // Copyright 2019 Raphaël Gomès <rgomes@octobus.net>
4 //
4 //
5 // This software may be used and distributed according to the terms of the
5 // This software may be used and distributed according to the terms of the
6 // GNU General Public License version 2 or any later version.
6 // GNU General Public License version 2 or any later version.
7
7
8 use crate::dirstate::parsers::Timestamp;
8 use crate::dirstate::parsers::Timestamp;
9 use crate::{
9 use crate::{
10 dirstate::EntryState,
10 dirstate::EntryState,
11 dirstate::MTIME_UNSET,
11 dirstate::MTIME_UNSET,
12 dirstate::SIZE_FROM_OTHER_PARENT,
12 dirstate::SIZE_FROM_OTHER_PARENT,
13 dirstate::SIZE_NON_NORMAL,
13 dirstate::SIZE_NON_NORMAL,
14 dirstate::V1_RANGEMASK,
14 dirstate::V1_RANGEMASK,
15 pack_dirstate, parse_dirstate,
15 pack_dirstate, parse_dirstate,
16 utils::hg_path::{HgPath, HgPathBuf},
16 utils::hg_path::{HgPath, HgPathBuf},
17 CopyMap, DirsMultiset, DirstateEntry, DirstateError, DirstateParents,
17 CopyMap, DirsMultiset, DirstateEntry, DirstateError, DirstateParents,
18 StateMap,
18 StateMap,
19 };
19 };
20 use micro_timer::timed;
20 use micro_timer::timed;
21 use std::collections::HashSet;
21 use std::collections::HashSet;
22 use std::iter::FromIterator;
22 use std::iter::FromIterator;
23 use std::ops::Deref;
23 use std::ops::Deref;
24
24
25 #[derive(Default)]
25 #[derive(Default)]
26 pub struct DirstateMap {
26 pub struct DirstateMap {
27 state_map: StateMap,
27 state_map: StateMap,
28 pub copy_map: CopyMap,
28 pub copy_map: CopyMap,
29 pub dirs: Option<DirsMultiset>,
29 pub dirs: Option<DirsMultiset>,
30 pub all_dirs: Option<DirsMultiset>,
30 pub all_dirs: Option<DirsMultiset>,
31 non_normal_set: Option<HashSet<HgPathBuf>>,
31 non_normal_set: Option<HashSet<HgPathBuf>>,
32 other_parent_set: Option<HashSet<HgPathBuf>>,
32 other_parent_set: Option<HashSet<HgPathBuf>>,
33 }
33 }
34
34
35 /// Should only really be used in python interface code, for clarity
35 /// Should only really be used in python interface code, for clarity
36 impl Deref for DirstateMap {
36 impl Deref for DirstateMap {
37 type Target = StateMap;
37 type Target = StateMap;
38
38
39 fn deref(&self) -> &Self::Target {
39 fn deref(&self) -> &Self::Target {
40 &self.state_map
40 &self.state_map
41 }
41 }
42 }
42 }
43
43
44 impl FromIterator<(HgPathBuf, DirstateEntry)> for DirstateMap {
44 impl FromIterator<(HgPathBuf, DirstateEntry)> for DirstateMap {
45 fn from_iter<I: IntoIterator<Item = (HgPathBuf, DirstateEntry)>>(
45 fn from_iter<I: IntoIterator<Item = (HgPathBuf, DirstateEntry)>>(
46 iter: I,
46 iter: I,
47 ) -> Self {
47 ) -> Self {
48 Self {
48 Self {
49 state_map: iter.into_iter().collect(),
49 state_map: iter.into_iter().collect(),
50 ..Self::default()
50 ..Self::default()
51 }
51 }
52 }
52 }
53 }
53 }
54
54
55 impl DirstateMap {
55 impl DirstateMap {
56 pub fn new() -> Self {
56 pub fn new() -> Self {
57 Self::default()
57 Self::default()
58 }
58 }
59
59
60 pub fn clear(&mut self) {
60 pub fn clear(&mut self) {
61 self.state_map = StateMap::default();
61 self.state_map = StateMap::default();
62 self.copy_map.clear();
62 self.copy_map.clear();
63 self.non_normal_set = None;
63 self.non_normal_set = None;
64 self.other_parent_set = None;
64 self.other_parent_set = None;
65 }
65 }
66
66
67 pub fn set_v1_inner(&mut self, filename: &HgPath, entry: DirstateEntry) {
67 pub fn set_v1_inner(&mut self, filename: &HgPath, entry: DirstateEntry) {
68 self.state_map.insert(filename.to_owned(), entry);
68 self.state_map.insert(filename.to_owned(), entry);
69 }
69 }
70
70
71 /// Add a tracked file to the dirstate
71 /// Add a tracked file to the dirstate
72 pub fn add_file(
72 pub fn add_file(
73 &mut self,
73 &mut self,
74 filename: &HgPath,
74 filename: &HgPath,
75 entry: DirstateEntry,
75 entry: DirstateEntry,
76 // XXX once the dust settle this should probably become an enum
76 // XXX once the dust settle this should probably become an enum
77 added: bool,
77 added: bool,
78 merged: bool,
78 merged: bool,
79 from_p2: bool,
79 from_p2: bool,
80 possibly_dirty: bool,
80 possibly_dirty: bool,
81 ) -> Result<(), DirstateError> {
81 ) -> Result<(), DirstateError> {
82 let state;
82 let state;
83 let size;
83 let size;
84 let mtime;
84 let mtime;
85 if added {
85 if added {
86 assert!(!possibly_dirty);
86 assert!(!possibly_dirty);
87 assert!(!from_p2);
87 assert!(!from_p2);
88 state = EntryState::Added;
88 state = EntryState::Added;
89 size = SIZE_NON_NORMAL;
89 size = SIZE_NON_NORMAL;
90 mtime = MTIME_UNSET;
90 mtime = MTIME_UNSET;
91 } else if merged {
91 } else if merged {
92 assert!(!possibly_dirty);
92 assert!(!possibly_dirty);
93 assert!(!from_p2);
93 assert!(!from_p2);
94 state = EntryState::Merged;
94 state = EntryState::Merged;
95 size = SIZE_FROM_OTHER_PARENT;
95 size = SIZE_FROM_OTHER_PARENT;
96 mtime = MTIME_UNSET;
96 mtime = MTIME_UNSET;
97 } else if from_p2 {
97 } else if from_p2 {
98 assert!(!possibly_dirty);
98 assert!(!possibly_dirty);
99 state = EntryState::Normal;
99 state = EntryState::Normal;
100 size = SIZE_FROM_OTHER_PARENT;
100 size = SIZE_FROM_OTHER_PARENT;
101 mtime = MTIME_UNSET;
101 mtime = MTIME_UNSET;
102 } else if possibly_dirty {
102 } else if possibly_dirty {
103 state = EntryState::Normal;
103 state = EntryState::Normal;
104 size = SIZE_NON_NORMAL;
104 size = SIZE_NON_NORMAL;
105 mtime = MTIME_UNSET;
105 mtime = MTIME_UNSET;
106 } else {
106 } else {
107 state = EntryState::Normal;
107 state = EntryState::Normal;
108 size = entry.size() & V1_RANGEMASK;
108 size = entry.size() & V1_RANGEMASK;
109 mtime = entry.mtime() & V1_RANGEMASK;
109 mtime = entry.mtime() & V1_RANGEMASK;
110 }
110 }
111 let mode = entry.mode();
111 let mode = entry.mode();
112 let entry = DirstateEntry::from_v1_data(state, mode, size, mtime);
112 let entry = DirstateEntry::from_v1_data(state, mode, size, mtime);
113
113
114 let old_state = self.get(filename).map(|e| e.state());
114 let old_state = self.get(filename).map(|e| e.state());
115 if old_state.is_none() || old_state == Some(EntryState::Removed) {
115 if old_state.is_none() || old_state == Some(EntryState::Removed) {
116 if let Some(ref mut dirs) = self.dirs {
116 if let Some(ref mut dirs) = self.dirs {
117 dirs.add_path(filename)?;
117 dirs.add_path(filename)?;
118 }
118 }
119 }
119 }
120 if old_state.is_none() {
120 if old_state.is_none() {
121 if let Some(ref mut all_dirs) = self.all_dirs {
121 if let Some(ref mut all_dirs) = self.all_dirs {
122 all_dirs.add_path(filename)?;
122 all_dirs.add_path(filename)?;
123 }
123 }
124 }
124 }
125 self.state_map.insert(filename.to_owned(), entry.to_owned());
125 self.state_map.insert(filename.to_owned(), entry.to_owned());
126
126
127 if entry.is_non_normal() {
127 if entry.is_non_normal() {
128 self.get_non_normal_other_parent_entries()
128 self.get_non_normal_other_parent_entries()
129 .0
129 .0
130 .insert(filename.to_owned());
130 .insert(filename.to_owned());
131 }
131 }
132
132
133 if entry.is_from_other_parent() {
133 if entry.is_from_other_parent() {
134 self.get_non_normal_other_parent_entries()
134 self.get_non_normal_other_parent_entries()
135 .1
135 .1
136 .insert(filename.to_owned());
136 .insert(filename.to_owned());
137 }
137 }
138 Ok(())
138 Ok(())
139 }
139 }
140
140
141 /// Mark a file as removed in the dirstate.
141 /// Mark a file as removed in the dirstate.
142 ///
142 ///
143 /// The `size` parameter is used to store sentinel values that indicate
143 /// The `size` parameter is used to store sentinel values that indicate
144 /// the file's previous state. In the future, we should refactor this
144 /// the file's previous state. In the future, we should refactor this
145 /// to be more explicit about what that state is.
145 /// to be more explicit about what that state is.
146 pub fn remove_file(
146 pub fn remove_file(
147 &mut self,
147 &mut self,
148 filename: &HgPath,
148 filename: &HgPath,
149 in_merge: bool,
149 in_merge: bool,
150 ) -> Result<(), DirstateError> {
150 ) -> Result<(), DirstateError> {
151 let old_entry_opt = self.get(filename);
151 let old_entry_opt = self.get(filename);
152 let old_state = old_entry_opt.map(|e| e.state());
152 let old_state = old_entry_opt.map(|e| e.state());
153 let mut size = 0;
153 let mut size = 0;
154 if in_merge {
154 if in_merge {
155 // XXX we should not be able to have 'm' state and 'FROM_P2' if not
155 // XXX we should not be able to have 'm' state and 'FROM_P2' if not
156 // during a merge. So I (marmoute) am not sure we need the
156 // during a merge. So I (marmoute) am not sure we need the
157 // conditionnal at all. Adding double checking this with assert
157 // conditionnal at all. Adding double checking this with assert
158 // would be nice.
158 // would be nice.
159 if let Some(old_entry) = old_entry_opt {
159 if let Some(old_entry) = old_entry_opt {
160 // backup the previous state
160 // backup the previous state
161 if old_entry.state() == EntryState::Merged {
161 if old_entry.state() == EntryState::Merged {
162 size = SIZE_NON_NORMAL;
162 size = SIZE_NON_NORMAL;
163 } else if old_entry.state() == EntryState::Normal
163 } else if old_entry.state() == EntryState::Normal
164 && old_entry.size() == SIZE_FROM_OTHER_PARENT
164 && old_entry.size() == SIZE_FROM_OTHER_PARENT
165 {
165 {
166 // other parent
166 // other parent
167 size = SIZE_FROM_OTHER_PARENT;
167 size = SIZE_FROM_OTHER_PARENT;
168 self.get_non_normal_other_parent_entries()
168 self.get_non_normal_other_parent_entries()
169 .1
169 .1
170 .insert(filename.to_owned());
170 .insert(filename.to_owned());
171 }
171 }
172 }
172 }
173 }
173 }
174 if old_state.is_some() && old_state != Some(EntryState::Removed) {
174 if old_state.is_some() && old_state != Some(EntryState::Removed) {
175 if let Some(ref mut dirs) = self.dirs {
175 if let Some(ref mut dirs) = self.dirs {
176 dirs.delete_path(filename)?;
176 dirs.delete_path(filename)?;
177 }
177 }
178 }
178 }
179 if old_state.is_none() {
179 if old_state.is_none() {
180 if let Some(ref mut all_dirs) = self.all_dirs {
180 if let Some(ref mut all_dirs) = self.all_dirs {
181 all_dirs.add_path(filename)?;
181 all_dirs.add_path(filename)?;
182 }
182 }
183 }
183 }
184 if size == 0 {
184 if size == 0 {
185 self.copy_map.remove(filename);
185 self.copy_map.remove(filename);
186 }
186 }
187
187
188 self.state_map
188 self.state_map
189 .insert(filename.to_owned(), DirstateEntry::new_removed(size));
189 .insert(filename.to_owned(), DirstateEntry::new_removed(size));
190 self.get_non_normal_other_parent_entries()
190 self.get_non_normal_other_parent_entries()
191 .0
191 .0
192 .insert(filename.to_owned());
192 .insert(filename.to_owned());
193 Ok(())
193 Ok(())
194 }
194 }
195
195
196 /// Remove a file from the dirstate.
196 /// Remove a file from the dirstate.
197 /// Returns `true` if the file was previously recorded.
197 /// Returns `true` if the file was previously recorded.
198 pub fn drop_file(
198 pub fn drop_file(
199 &mut self,
199 &mut self,
200 filename: &HgPath,
200 filename: &HgPath,
201 ) -> Result<bool, DirstateError> {
201 ) -> Result<bool, DirstateError> {
202 let old_state = self.get(filename).map(|e| e.state());
202 let old_state = self.get(filename).map(|e| e.state());
203 let exists = self.state_map.remove(filename).is_some();
203 let exists = self.state_map.remove(filename).is_some();
204
204
205 if exists {
205 if exists {
206 if old_state != Some(EntryState::Removed) {
206 if old_state != Some(EntryState::Removed) {
207 if let Some(ref mut dirs) = self.dirs {
207 if let Some(ref mut dirs) = self.dirs {
208 dirs.delete_path(filename)?;
208 dirs.delete_path(filename)?;
209 }
209 }
210 }
210 }
211 if let Some(ref mut all_dirs) = self.all_dirs {
211 if let Some(ref mut all_dirs) = self.all_dirs {
212 all_dirs.delete_path(filename)?;
212 all_dirs.delete_path(filename)?;
213 }
213 }
214 }
214 }
215 self.get_non_normal_other_parent_entries()
215 self.get_non_normal_other_parent_entries()
216 .0
216 .0
217 .remove(filename);
217 .remove(filename);
218
218
219 Ok(exists)
219 Ok(exists)
220 }
220 }
221
221
222 pub fn clear_ambiguous_times(
222 pub fn clear_ambiguous_times(
223 &mut self,
223 &mut self,
224 filenames: Vec<HgPathBuf>,
224 filenames: Vec<HgPathBuf>,
225 now: i32,
225 now: i32,
226 ) {
226 ) {
227 for filename in filenames {
227 for filename in filenames {
228 if let Some(entry) = self.state_map.get_mut(&filename) {
228 if let Some(entry) = self.state_map.get_mut(&filename) {
229 if entry.clear_ambiguous_mtime(now) {
229 if entry.clear_ambiguous_mtime(now) {
230 self.get_non_normal_other_parent_entries()
230 self.get_non_normal_other_parent_entries()
231 .0
231 .0
232 .insert(filename.to_owned());
232 .insert(filename.to_owned());
233 }
233 }
234 }
234 }
235 }
235 }
236 }
236 }
237
237
238 pub fn non_normal_entries_remove(
238 pub fn non_normal_entries_remove(
239 &mut self,
239 &mut self,
240 key: impl AsRef<HgPath>,
240 key: impl AsRef<HgPath>,
241 ) -> bool {
241 ) -> bool {
242 self.get_non_normal_other_parent_entries()
242 self.get_non_normal_other_parent_entries()
243 .0
243 .0
244 .remove(key.as_ref())
244 .remove(key.as_ref())
245 }
245 }
246
246
247 pub fn non_normal_entries_add(&mut self, key: impl AsRef<HgPath>) {
247 pub fn non_normal_entries_add(&mut self, key: impl AsRef<HgPath>) {
248 self.get_non_normal_other_parent_entries()
248 self.get_non_normal_other_parent_entries()
249 .0
249 .0
250 .insert(key.as_ref().into());
250 .insert(key.as_ref().into());
251 }
251 }
252
252
253 pub fn non_normal_entries_union(
253 pub fn non_normal_entries_union(
254 &mut self,
254 &mut self,
255 other: HashSet<HgPathBuf>,
255 other: HashSet<HgPathBuf>,
256 ) -> Vec<HgPathBuf> {
256 ) -> Vec<HgPathBuf> {
257 self.get_non_normal_other_parent_entries()
257 self.get_non_normal_other_parent_entries()
258 .0
258 .0
259 .union(&other)
259 .union(&other)
260 .map(ToOwned::to_owned)
260 .map(ToOwned::to_owned)
261 .collect()
261 .collect()
262 }
262 }
263
263
264 pub fn get_non_normal_other_parent_entries(
264 pub fn get_non_normal_other_parent_entries(
265 &mut self,
265 &mut self,
266 ) -> (&mut HashSet<HgPathBuf>, &mut HashSet<HgPathBuf>) {
266 ) -> (&mut HashSet<HgPathBuf>, &mut HashSet<HgPathBuf>) {
267 self.set_non_normal_other_parent_entries(false);
267 self.set_non_normal_other_parent_entries(false);
268 (
268 (
269 self.non_normal_set.as_mut().unwrap(),
269 self.non_normal_set.as_mut().unwrap(),
270 self.other_parent_set.as_mut().unwrap(),
270 self.other_parent_set.as_mut().unwrap(),
271 )
271 )
272 }
272 }
273
273
274 /// Useful to get immutable references to those sets in contexts where
274 /// Useful to get immutable references to those sets in contexts where
275 /// you only have an immutable reference to the `DirstateMap`, like when
275 /// you only have an immutable reference to the `DirstateMap`, like when
276 /// sharing references with Python.
276 /// sharing references with Python.
277 ///
277 ///
278 /// TODO, get rid of this along with the other "setter/getter" stuff when
278 /// TODO, get rid of this along with the other "setter/getter" stuff when
279 /// a nice typestate plan is defined.
279 /// a nice typestate plan is defined.
280 ///
280 ///
281 /// # Panics
281 /// # Panics
282 ///
282 ///
283 /// Will panic if either set is `None`.
283 /// Will panic if either set is `None`.
284 pub fn get_non_normal_other_parent_entries_panic(
284 pub fn get_non_normal_other_parent_entries_panic(
285 &self,
285 &self,
286 ) -> (&HashSet<HgPathBuf>, &HashSet<HgPathBuf>) {
286 ) -> (&HashSet<HgPathBuf>, &HashSet<HgPathBuf>) {
287 (
287 (
288 self.non_normal_set.as_ref().unwrap(),
288 self.non_normal_set.as_ref().unwrap(),
289 self.other_parent_set.as_ref().unwrap(),
289 self.other_parent_set.as_ref().unwrap(),
290 )
290 )
291 }
291 }
292
292
293 pub fn set_non_normal_other_parent_entries(&mut self, force: bool) {
293 pub fn set_non_normal_other_parent_entries(&mut self, force: bool) {
294 if !force
294 if !force
295 && self.non_normal_set.is_some()
295 && self.non_normal_set.is_some()
296 && self.other_parent_set.is_some()
296 && self.other_parent_set.is_some()
297 {
297 {
298 return;
298 return;
299 }
299 }
300 let mut non_normal = HashSet::new();
300 let mut non_normal = HashSet::new();
301 let mut other_parent = HashSet::new();
301 let mut other_parent = HashSet::new();
302
302
303 for (filename, entry) in self.state_map.iter() {
303 for (filename, entry) in self.state_map.iter() {
304 if entry.is_non_normal() {
304 if entry.is_non_normal() {
305 non_normal.insert(filename.to_owned());
305 non_normal.insert(filename.to_owned());
306 }
306 }
307 if entry.is_from_other_parent() {
307 if entry.is_from_other_parent() {
308 other_parent.insert(filename.to_owned());
308 other_parent.insert(filename.to_owned());
309 }
309 }
310 }
310 }
311 self.non_normal_set = Some(non_normal);
311 self.non_normal_set = Some(non_normal);
312 self.other_parent_set = Some(other_parent);
312 self.other_parent_set = Some(other_parent);
313 }
313 }
314
314
315 /// Both of these setters and their uses appear to be the simplest way to
315 /// Both of these setters and their uses appear to be the simplest way to
316 /// emulate a Python lazy property, but it is ugly and unidiomatic.
316 /// emulate a Python lazy property, but it is ugly and unidiomatic.
317 /// TODO One day, rewriting this struct using the typestate might be a
317 /// TODO One day, rewriting this struct using the typestate might be a
318 /// good idea.
318 /// good idea.
319 pub fn set_all_dirs(&mut self) -> Result<(), DirstateError> {
319 pub fn set_all_dirs(&mut self) -> Result<(), DirstateError> {
320 if self.all_dirs.is_none() {
320 if self.all_dirs.is_none() {
321 self.all_dirs = Some(DirsMultiset::from_dirstate(
321 self.all_dirs = Some(DirsMultiset::from_dirstate(
322 self.state_map.iter().map(|(k, v)| Ok((k, *v))),
322 self.state_map.iter().map(|(k, v)| Ok((k, *v))),
323 false,
323 false,
324 )?);
324 )?);
325 }
325 }
326 Ok(())
326 Ok(())
327 }
327 }
328
328
329 pub fn set_dirs(&mut self) -> Result<(), DirstateError> {
329 pub fn set_dirs(&mut self) -> Result<(), DirstateError> {
330 if self.dirs.is_none() {
330 if self.dirs.is_none() {
331 self.dirs = Some(DirsMultiset::from_dirstate(
331 self.dirs = Some(DirsMultiset::from_dirstate(
332 self.state_map.iter().map(|(k, v)| Ok((k, *v))),
332 self.state_map.iter().map(|(k, v)| Ok((k, *v))),
333 true,
333 true,
334 )?);
334 )?);
335 }
335 }
336 Ok(())
336 Ok(())
337 }
337 }
338
338
339 pub fn has_tracked_dir(
339 pub fn has_tracked_dir(
340 &mut self,
340 &mut self,
341 directory: &HgPath,
341 directory: &HgPath,
342 ) -> Result<bool, DirstateError> {
342 ) -> Result<bool, DirstateError> {
343 self.set_dirs()?;
343 self.set_dirs()?;
344 Ok(self.dirs.as_ref().unwrap().contains(directory))
344 Ok(self.dirs.as_ref().unwrap().contains(directory))
345 }
345 }
346
346
347 pub fn has_dir(
347 pub fn has_dir(
348 &mut self,
348 &mut self,
349 directory: &HgPath,
349 directory: &HgPath,
350 ) -> Result<bool, DirstateError> {
350 ) -> Result<bool, DirstateError> {
351 self.set_all_dirs()?;
351 self.set_all_dirs()?;
352 Ok(self.all_dirs.as_ref().unwrap().contains(directory))
352 Ok(self.all_dirs.as_ref().unwrap().contains(directory))
353 }
353 }
354
354
355 #[timed]
355 #[timed]
356 pub fn read(
356 pub fn read(
357 &mut self,
357 &mut self,
358 file_contents: &[u8],
358 file_contents: &[u8],
359 ) -> Result<Option<DirstateParents>, DirstateError> {
359 ) -> Result<Option<DirstateParents>, DirstateError> {
360 if file_contents.is_empty() {
360 if file_contents.is_empty() {
361 return Ok(None);
361 return Ok(None);
362 }
362 }
363
363
364 let (parents, entries, copies) = parse_dirstate(file_contents)?;
364 let (parents, entries, copies) = parse_dirstate(file_contents)?;
365 self.state_map.extend(
365 self.state_map.extend(
366 entries
366 entries
367 .into_iter()
367 .into_iter()
368 .map(|(path, entry)| (path.to_owned(), entry)),
368 .map(|(path, entry)| (path.to_owned(), entry)),
369 );
369 );
370 self.copy_map.extend(
370 self.copy_map.extend(
371 copies
371 copies
372 .into_iter()
372 .into_iter()
373 .map(|(path, copy)| (path.to_owned(), copy.to_owned())),
373 .map(|(path, copy)| (path.to_owned(), copy.to_owned())),
374 );
374 );
375 Ok(Some(parents.clone()))
375 Ok(Some(parents.clone()))
376 }
376 }
377
377
378 pub fn pack(
378 pub fn pack(
379 &mut self,
379 &mut self,
380 parents: DirstateParents,
380 parents: DirstateParents,
381 now: Timestamp,
381 now: Timestamp,
382 ) -> Result<Vec<u8>, DirstateError> {
382 ) -> Result<Vec<u8>, DirstateError> {
383 let packed =
383 let packed =
384 pack_dirstate(&mut self.state_map, &self.copy_map, parents, now)?;
384 pack_dirstate(&mut self.state_map, &self.copy_map, parents, now)?;
385
385
386 self.set_non_normal_other_parent_entries(true);
386 self.set_non_normal_other_parent_entries(true);
387 Ok(packed)
387 Ok(packed)
388 }
388 }
389 }
389 }
390
390
391 #[cfg(test)]
391 #[cfg(test)]
392 mod tests {
392 mod tests {
393 use super::*;
393 use super::*;
394
394
395 #[test]
395 #[test]
396 fn test_dirs_multiset() {
396 fn test_dirs_multiset() {
397 let mut map = DirstateMap::new();
397 let mut map = DirstateMap::new();
398 assert!(map.dirs.is_none());
398 assert!(map.dirs.is_none());
399 assert!(map.all_dirs.is_none());
399 assert!(map.all_dirs.is_none());
400
400
401 assert_eq!(map.has_dir(HgPath::new(b"nope")).unwrap(), false);
401 assert_eq!(map.has_dir(HgPath::new(b"nope")).unwrap(), false);
402 assert!(map.all_dirs.is_some());
402 assert!(map.all_dirs.is_some());
403 assert!(map.dirs.is_none());
403 assert!(map.dirs.is_none());
404
404
405 assert_eq!(map.has_tracked_dir(HgPath::new(b"nope")).unwrap(), false);
405 assert_eq!(map.has_tracked_dir(HgPath::new(b"nope")).unwrap(), false);
406 assert!(map.dirs.is_some());
406 assert!(map.dirs.is_some());
407 }
407 }
408
408
409 #[test]
409 #[test]
410 fn test_add_file() {
410 fn test_add_file() {
411 let mut map = DirstateMap::new();
411 let mut map = DirstateMap::new();
412
412
413 assert_eq!(0, map.len());
413 assert_eq!(0, map.len());
414
414
415 map.add_file(
415 map.add_file(
416 HgPath::new(b"meh"),
416 HgPath::new(b"meh"),
417 DirstateEntry::from_v1_data(EntryState::Normal, 1337, 1337, 1337),
417 DirstateEntry::from_v1_data(EntryState::Normal, 1337, 1337, 1337),
418 false,
418 false,
419 false,
419 false,
420 false,
420 false,
421 false,
421 false,
422 )
422 )
423 .unwrap();
423 .unwrap();
424
424
425 assert_eq!(1, map.len());
425 assert_eq!(1, map.len());
426 assert_eq!(0, map.get_non_normal_other_parent_entries().0.len());
426 assert_eq!(0, map.get_non_normal_other_parent_entries().0.len());
427 assert_eq!(0, map.get_non_normal_other_parent_entries().1.len());
427 assert_eq!(0, map.get_non_normal_other_parent_entries().1.len());
428 }
428 }
429
429
430 #[test]
430 #[test]
431 fn test_non_normal_other_parent_entries() {
431 fn test_non_normal_other_parent_entries() {
432 let mut map: DirstateMap = [
432 let mut map: DirstateMap = [
433 (b"f1", (EntryState::Removed, 1337, 1337, 1337)),
433 (b"f1", (EntryState::Removed, 1337, 1337, 1337)),
434 (b"f2", (EntryState::Normal, 1337, 1337, -1)),
434 (b"f2", (EntryState::Normal, 1337, 1337, -1)),
435 (b"f3", (EntryState::Normal, 1337, 1337, 1337)),
435 (b"f3", (EntryState::Normal, 1337, 1337, 1337)),
436 (b"f4", (EntryState::Normal, 1337, -2, 1337)),
436 (b"f4", (EntryState::Normal, 1337, -2, 1337)),
437 (b"f5", (EntryState::Added, 1337, 1337, 1337)),
437 (b"f5", (EntryState::Added, 1337, 1337, 1337)),
438 (b"f6", (EntryState::Added, 1337, 1337, -1)),
438 (b"f6", (EntryState::Added, 1337, 1337, -1)),
439 (b"f7", (EntryState::Merged, 1337, 1337, -1)),
439 (b"f7", (EntryState::Merged, 1337, 1337, -1)),
440 (b"f8", (EntryState::Merged, 1337, 1337, 1337)),
440 (b"f8", (EntryState::Merged, 1337, 1337, 1337)),
441 (b"f9", (EntryState::Merged, 1337, -2, 1337)),
441 (b"f9", (EntryState::Merged, 1337, -2, 1337)),
442 (b"fa", (EntryState::Added, 1337, -2, 1337)),
442 (b"fa", (EntryState::Added, 1337, -2, 1337)),
443 (b"fb", (EntryState::Removed, 1337, -2, 1337)),
443 (b"fb", (EntryState::Removed, 1337, -2, 1337)),
444 ]
444 ]
445 .iter()
445 .iter()
446 .map(|(fname, (state, mode, size, mtime))| {
446 .map(|(fname, (state, mode, size, mtime))| {
447 (
447 (
448 HgPathBuf::from_bytes(fname.as_ref()),
448 HgPathBuf::from_bytes(fname.as_ref()),
449 DirstateEntry::from_v1_data(*state, *mode, *size, *mtime),
449 DirstateEntry::from_v1_data(*state, *mode, *size, *mtime),
450 )
450 )
451 })
451 })
452 .collect();
452 .collect();
453
453
454 let mut non_normal = [
454 let mut non_normal = [
455 b"f1", b"f2", b"f5", b"f6", b"f7", b"f8", b"f9", b"fa", b"fb",
455 b"f1", b"f2", b"f4", b"f5", b"f6", b"f7", b"f8", b"f9", b"fa",
456 b"fb",
456 ]
457 ]
457 .iter()
458 .iter()
458 .map(|x| HgPathBuf::from_bytes(x.as_ref()))
459 .map(|x| HgPathBuf::from_bytes(x.as_ref()))
459 .collect();
460 .collect();
460
461
461 let mut other_parent = HashSet::new();
462 let mut other_parent = HashSet::new();
462 other_parent.insert(HgPathBuf::from_bytes(b"f4"));
463 other_parent.insert(HgPathBuf::from_bytes(b"f4"));
463 let entries = map.get_non_normal_other_parent_entries();
464 let entries = map.get_non_normal_other_parent_entries();
464
465
465 assert_eq!(
466 assert_eq!(
466 (&mut non_normal, &mut other_parent),
467 (&mut non_normal, &mut other_parent),
467 (entries.0, entries.1)
468 (entries.0, entries.1)
468 );
469 );
469 }
470 }
470 }
471 }
@@ -1,190 +1,345 b''
1 use crate::errors::HgError;
1 use crate::errors::HgError;
2 use bitflags::bitflags;
2 use std::convert::TryFrom;
3 use std::convert::TryFrom;
3
4
4 #[derive(Copy, Clone, Debug, Eq, PartialEq)]
5 #[derive(Copy, Clone, Debug, Eq, PartialEq)]
5 pub enum EntryState {
6 pub enum EntryState {
6 Normal,
7 Normal,
7 Added,
8 Added,
8 Removed,
9 Removed,
9 Merged,
10 Merged,
10 }
11 }
11
12
12 /// The C implementation uses all signed types. This will be an issue
13 /// The C implementation uses all signed types. This will be an issue
13 /// either when 4GB+ source files are commonplace or in 2038, whichever
14 /// either when 4GB+ source files are commonplace or in 2038, whichever
14 /// comes first.
15 /// comes first.
15 #[derive(Debug, PartialEq, Copy, Clone)]
16 #[derive(Debug, PartialEq, Copy, Clone)]
16 pub struct DirstateEntry {
17 pub struct DirstateEntry {
17 state: EntryState,
18 flags: Flags,
18 mode: i32,
19 mode: i32,
19 size: i32,
20 size: i32,
20 mtime: i32,
21 mtime: i32,
21 }
22 }
22
23
24 bitflags! {
25 struct Flags: u8 {
26 const WDIR_TRACKED = 1 << 0;
27 const P1_TRACKED = 1 << 1;
28 const P2_TRACKED = 1 << 2;
29 const POSSIBLY_DIRTY = 1 << 3;
30 const MERGED = 1 << 4;
31 const CLEAN_P1 = 1 << 5;
32 const CLEAN_P2 = 1 << 6;
33 const ENTRYLESS_TREE_NODE = 1 << 7;
34 }
35 }
36
23 pub const V1_RANGEMASK: i32 = 0x7FFFFFFF;
37 pub const V1_RANGEMASK: i32 = 0x7FFFFFFF;
24
38
25 pub const MTIME_UNSET: i32 = -1;
39 pub const MTIME_UNSET: i32 = -1;
26
40
27 /// A `DirstateEntry` with a size of `-2` means that it was merged from the
41 /// A `DirstateEntry` with a size of `-2` means that it was merged from the
28 /// other parent. This allows revert to pick the right status back during a
42 /// other parent. This allows revert to pick the right status back during a
29 /// merge.
43 /// merge.
30 pub const SIZE_FROM_OTHER_PARENT: i32 = -2;
44 pub const SIZE_FROM_OTHER_PARENT: i32 = -2;
31 /// A special value used for internal representation of special case in
45 /// A special value used for internal representation of special case in
32 /// dirstate v1 format.
46 /// dirstate v1 format.
33 pub const SIZE_NON_NORMAL: i32 = -1;
47 pub const SIZE_NON_NORMAL: i32 = -1;
34
48
35 impl DirstateEntry {
49 impl DirstateEntry {
36 pub fn from_v1_data(
50 pub fn from_v1_data(
37 state: EntryState,
51 state: EntryState,
38 mode: i32,
52 mode: i32,
39 size: i32,
53 size: i32,
40 mtime: i32,
54 mtime: i32,
41 ) -> Self {
55 ) -> Self {
56 match state {
57 EntryState::Normal => {
58 if size == SIZE_FROM_OTHER_PARENT {
59 Self::new_from_p2()
60 } else if size == SIZE_NON_NORMAL {
61 Self::new_possibly_dirty()
62 } else if mtime == MTIME_UNSET {
63 Self {
64 flags: Flags::WDIR_TRACKED
65 | Flags::P1_TRACKED
66 | Flags::POSSIBLY_DIRTY,
67 mode,
68 size,
69 mtime: 0,
70 }
71 } else {
72 Self {
73 flags: Flags::WDIR_TRACKED | Flags::P1_TRACKED,
74 mode,
75 size,
76 mtime,
77 }
78 }
79 }
80 EntryState::Added => Self::new_added(),
81 EntryState::Removed => Self {
82 flags: if size == SIZE_NON_NORMAL {
83 Flags::P1_TRACKED // might not be true because of rename ?
84 | Flags::P2_TRACKED // might not be true because of rename ?
85 | Flags::MERGED
86 } else if size == SIZE_FROM_OTHER_PARENT {
87 // We don’t know if P1_TRACKED should be set (file history)
88 Flags::P2_TRACKED | Flags::CLEAN_P2
89 } else {
90 Flags::P1_TRACKED
91 },
92 mode: 0,
93 size: 0,
94 mtime: 0,
95 },
96 EntryState::Merged => Self::new_merged(),
97 }
98 }
99
100 fn new_from_p2() -> Self {
42 Self {
101 Self {
43 state,
102 // might be missing P1_TRACKED
44 mode,
103 flags: Flags::WDIR_TRACKED | Flags::P2_TRACKED | Flags::CLEAN_P2,
45 size,
104 mode: 0,
46 mtime,
105 size: SIZE_FROM_OTHER_PARENT,
106 mtime: MTIME_UNSET,
107 }
108 }
109
110 fn new_possibly_dirty() -> Self {
111 Self {
112 flags: Flags::WDIR_TRACKED
113 | Flags::P1_TRACKED
114 | Flags::POSSIBLY_DIRTY,
115 mode: 0,
116 size: SIZE_NON_NORMAL,
117 mtime: MTIME_UNSET,
118 }
119 }
120
121 fn new_added() -> Self {
122 Self {
123 flags: Flags::WDIR_TRACKED,
124 mode: 0,
125 size: SIZE_NON_NORMAL,
126 mtime: MTIME_UNSET,
127 }
128 }
129
130 fn new_merged() -> Self {
131 Self {
132 flags: Flags::WDIR_TRACKED
133 | Flags::P1_TRACKED // might not be true because of rename ?
134 | Flags::P2_TRACKED // might not be true because of rename ?
135 | Flags::MERGED,
136 mode: 0,
137 size: SIZE_NON_NORMAL,
138 mtime: MTIME_UNSET,
47 }
139 }
48 }
140 }
49
141
50 /// Creates a new entry in "removed" state.
142 /// Creates a new entry in "removed" state.
51 ///
143 ///
52 /// `size` is expected to be zero, `SIZE_NON_NORMAL`, or
144 /// `size` is expected to be zero, `SIZE_NON_NORMAL`, or
53 /// `SIZE_FROM_OTHER_PARENT`
145 /// `SIZE_FROM_OTHER_PARENT`
54 pub fn new_removed(size: i32) -> Self {
146 pub fn new_removed(size: i32) -> Self {
55 Self {
147 Self::from_v1_data(EntryState::Removed, 0, size, 0)
56 state: EntryState::Removed,
57 mode: 0,
58 size,
59 mtime: 0,
60 }
61 }
148 }
62
149
63 /// TODO: refactor `DirstateMap::add_file` to not take a `DirstateEntry`
150 /// TODO: refactor `DirstateMap::add_file` to not take a `DirstateEntry`
64 /// parameter and remove this constructor
151 /// parameter and remove this constructor
65 pub fn new_for_add_file(mode: i32, size: i32, mtime: i32) -> Self {
152 pub fn new_for_add_file(mode: i32, size: i32, mtime: i32) -> Self {
66 Self {
153 // XXX Arbitrary default value since the value is determined later
67 // XXX Arbitrary default value since the value is determined later
154 let state = EntryState::Normal;
68 state: EntryState::Normal,
155 Self::from_v1_data(state, mode, size, mtime)
69 mode,
156 }
70 size,
157
71 mtime,
158 fn tracked_in_any_parent(&self) -> bool {
72 }
159 self.flags.intersects(Flags::P1_TRACKED | Flags::P2_TRACKED)
160 }
161
162 fn removed(&self) -> bool {
163 self.tracked_in_any_parent()
164 && !self.flags.contains(Flags::WDIR_TRACKED)
165 }
166
167 fn merged_removed(&self) -> bool {
168 self.removed() && self.flags.contains(Flags::MERGED)
169 }
170
171 fn from_p2_removed(&self) -> bool {
172 self.removed() && self.flags.contains(Flags::CLEAN_P2)
173 }
174
175 fn merged(&self) -> bool {
176 self.flags.contains(Flags::WDIR_TRACKED | Flags::MERGED)
177 }
178
179 fn added(&self) -> bool {
180 self.flags.contains(Flags::WDIR_TRACKED)
181 && !self.tracked_in_any_parent()
182 }
183
184 fn from_p2(&self) -> bool {
185 self.flags.contains(Flags::WDIR_TRACKED | Flags::CLEAN_P2)
73 }
186 }
74
187
75 pub fn state(&self) -> EntryState {
188 pub fn state(&self) -> EntryState {
76 self.state
189 if self.removed() {
190 EntryState::Removed
191 } else if self.merged() {
192 EntryState::Merged
193 } else if self.added() {
194 EntryState::Added
195 } else {
196 EntryState::Normal
197 }
77 }
198 }
78
199
79 pub fn mode(&self) -> i32 {
200 pub fn mode(&self) -> i32 {
80 self.mode
201 self.mode
81 }
202 }
82
203
83 pub fn size(&self) -> i32 {
204 pub fn size(&self) -> i32 {
84 self.size
205 if self.merged_removed() {
206 SIZE_NON_NORMAL
207 } else if self.from_p2_removed() {
208 SIZE_FROM_OTHER_PARENT
209 } else if self.removed() {
210 0
211 } else if self.merged() {
212 SIZE_FROM_OTHER_PARENT
213 } else if self.added() {
214 SIZE_NON_NORMAL
215 } else if self.from_p2() {
216 SIZE_FROM_OTHER_PARENT
217 } else if self.flags.contains(Flags::POSSIBLY_DIRTY) {
218 self.size // TODO: SIZE_NON_NORMAL ?
219 } else {
220 self.size
221 }
85 }
222 }
86
223
87 pub fn mtime(&self) -> i32 {
224 pub fn mtime(&self) -> i32 {
88 self.mtime
225 if self.removed() {
226 0
227 } else if self.flags.contains(Flags::POSSIBLY_DIRTY) {
228 MTIME_UNSET
229 } else if self.merged() {
230 MTIME_UNSET
231 } else if self.added() {
232 MTIME_UNSET
233 } else if self.from_p2() {
234 MTIME_UNSET
235 } else {
236 self.mtime
237 }
89 }
238 }
90
239
91 /// Returns `(state, mode, size, mtime)` for the puprose of serialization
240 /// Returns `(state, mode, size, mtime)` for the puprose of serialization
92 /// in the dirstate-v1 format.
241 /// in the dirstate-v1 format.
93 ///
242 ///
94 /// This includes marker values such as `mtime == -1`. In the future we may
243 /// This includes marker values such as `mtime == -1`. In the future we may
95 /// want to not represent these cases that way in memory, but serialization
244 /// want to not represent these cases that way in memory, but serialization
96 /// will need to keep the same format.
245 /// will need to keep the same format.
97 pub fn v1_data(&self) -> (u8, i32, i32, i32) {
246 pub fn v1_data(&self) -> (u8, i32, i32, i32) {
98 (self.state.into(), self.mode, self.size, self.mtime)
247 (self.state().into(), self.mode(), self.size(), self.mtime())
99 }
248 }
100
249
101 pub fn is_non_normal(&self) -> bool {
250 pub fn is_non_normal(&self) -> bool {
102 self.state != EntryState::Normal || self.mtime == MTIME_UNSET
251 self.state() != EntryState::Normal || self.mtime() == MTIME_UNSET
103 }
252 }
104
253
105 pub fn is_from_other_parent(&self) -> bool {
254 pub fn is_from_other_parent(&self) -> bool {
106 self.state == EntryState::Normal && self.size == SIZE_FROM_OTHER_PARENT
255 self.state() == EntryState::Normal
256 && self.size() == SIZE_FROM_OTHER_PARENT
107 }
257 }
108
258
109 // TODO: other platforms
259 // TODO: other platforms
110 #[cfg(unix)]
260 #[cfg(unix)]
111 pub fn mode_changed(
261 pub fn mode_changed(
112 &self,
262 &self,
113 filesystem_metadata: &std::fs::Metadata,
263 filesystem_metadata: &std::fs::Metadata,
114 ) -> bool {
264 ) -> bool {
115 use std::os::unix::fs::MetadataExt;
265 use std::os::unix::fs::MetadataExt;
116 const EXEC_BIT_MASK: u32 = 0o100;
266 const EXEC_BIT_MASK: u32 = 0o100;
117 let dirstate_exec_bit = (self.mode as u32) & EXEC_BIT_MASK;
267 let dirstate_exec_bit = (self.mode() as u32) & EXEC_BIT_MASK;
118 let fs_exec_bit = filesystem_metadata.mode() & EXEC_BIT_MASK;
268 let fs_exec_bit = filesystem_metadata.mode() & EXEC_BIT_MASK;
119 dirstate_exec_bit != fs_exec_bit
269 dirstate_exec_bit != fs_exec_bit
120 }
270 }
121
271
122 /// Returns a `(state, mode, size, mtime)` tuple as for
272 /// Returns a `(state, mode, size, mtime)` tuple as for
123 /// `DirstateMapMethods::debug_iter`.
273 /// `DirstateMapMethods::debug_iter`.
124 pub fn debug_tuple(&self) -> (u8, i32, i32, i32) {
274 pub fn debug_tuple(&self) -> (u8, i32, i32, i32) {
125 (self.state.into(), self.mode, self.size, self.mtime)
275 let state = if self.flags.contains(Flags::ENTRYLESS_TREE_NODE) {
276 b' '
277 } else {
278 self.state().into()
279 };
280 (state, self.mode(), self.size(), self.mtime())
126 }
281 }
127
282
128 pub fn mtime_is_ambiguous(&self, now: i32) -> bool {
283 pub fn mtime_is_ambiguous(&self, now: i32) -> bool {
129 self.state == EntryState::Normal && self.mtime == now
284 self.state() == EntryState::Normal && self.mtime() == now
130 }
285 }
131
286
132 pub fn clear_ambiguous_mtime(&mut self, now: i32) -> bool {
287 pub fn clear_ambiguous_mtime(&mut self, now: i32) -> bool {
133 let ambiguous = self.mtime_is_ambiguous(now);
288 let ambiguous = self.mtime_is_ambiguous(now);
134 if ambiguous {
289 if ambiguous {
135 // The file was last modified "simultaneously" with the current
290 // The file was last modified "simultaneously" with the current
136 // write to dirstate (i.e. within the same second for file-
291 // write to dirstate (i.e. within the same second for file-
137 // systems with a granularity of 1 sec). This commonly happens
292 // systems with a granularity of 1 sec). This commonly happens
138 // for at least a couple of files on 'update'.
293 // for at least a couple of files on 'update'.
139 // The user could change the file without changing its size
294 // The user could change the file without changing its size
140 // within the same second. Invalidate the file's mtime in
295 // within the same second. Invalidate the file's mtime in
141 // dirstate, forcing future 'status' calls to compare the
296 // dirstate, forcing future 'status' calls to compare the
142 // contents of the file if the size is the same. This prevents
297 // contents of the file if the size is the same. This prevents
143 // mistakenly treating such files as clean.
298 // mistakenly treating such files as clean.
144 self.clear_mtime()
299 self.clear_mtime()
145 }
300 }
146 ambiguous
301 ambiguous
147 }
302 }
148
303
149 pub fn clear_mtime(&mut self) {
304 pub fn clear_mtime(&mut self) {
150 self.mtime = -1;
305 self.mtime = -1;
151 }
306 }
152 }
307 }
153
308
154 impl EntryState {
309 impl EntryState {
155 pub fn is_tracked(self) -> bool {
310 pub fn is_tracked(self) -> bool {
156 use EntryState::*;
311 use EntryState::*;
157 match self {
312 match self {
158 Normal | Added | Merged => true,
313 Normal | Added | Merged => true,
159 Removed => false,
314 Removed => false,
160 }
315 }
161 }
316 }
162 }
317 }
163
318
164 impl TryFrom<u8> for EntryState {
319 impl TryFrom<u8> for EntryState {
165 type Error = HgError;
320 type Error = HgError;
166
321
167 fn try_from(value: u8) -> Result<Self, Self::Error> {
322 fn try_from(value: u8) -> Result<Self, Self::Error> {
168 match value {
323 match value {
169 b'n' => Ok(EntryState::Normal),
324 b'n' => Ok(EntryState::Normal),
170 b'a' => Ok(EntryState::Added),
325 b'a' => Ok(EntryState::Added),
171 b'r' => Ok(EntryState::Removed),
326 b'r' => Ok(EntryState::Removed),
172 b'm' => Ok(EntryState::Merged),
327 b'm' => Ok(EntryState::Merged),
173 _ => Err(HgError::CorruptedRepository(format!(
328 _ => Err(HgError::CorruptedRepository(format!(
174 "Incorrect dirstate entry state {}",
329 "Incorrect dirstate entry state {}",
175 value
330 value
176 ))),
331 ))),
177 }
332 }
178 }
333 }
179 }
334 }
180
335
181 impl Into<u8> for EntryState {
336 impl Into<u8> for EntryState {
182 fn into(self) -> u8 {
337 fn into(self) -> u8 {
183 match self {
338 match self {
184 EntryState::Normal => b'n',
339 EntryState::Normal => b'n',
185 EntryState::Added => b'a',
340 EntryState::Added => b'a',
186 EntryState::Removed => b'r',
341 EntryState::Removed => b'r',
187 EntryState::Merged => b'm',
342 EntryState::Merged => b'm',
188 }
343 }
189 }
344 }
190 }
345 }
General Comments 0
You need to be logged in to leave comments. Login now