##// END OF EJS Templates
rhg: use `format_bytes!` for error messages...
Raphaël Gomès -
r46598:fada3387 default
parent child Browse files
Show More
@@ -1,967 +1,996 b''
1 1 # This file is automatically @generated by Cargo.
2 2 # It is not intended for manual editing.
3 3 [[package]]
4 4 name = "adler"
5 5 version = "0.2.3"
6 6 source = "registry+https://github.com/rust-lang/crates.io-index"
7 7
8 8 [[package]]
9 9 name = "aho-corasick"
10 10 version = "0.7.13"
11 11 source = "registry+https://github.com/rust-lang/crates.io-index"
12 12 dependencies = [
13 13 "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
14 14 ]
15 15
16 16 [[package]]
17 17 name = "ansi_term"
18 18 version = "0.11.0"
19 19 source = "registry+https://github.com/rust-lang/crates.io-index"
20 20 dependencies = [
21 21 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
22 22 ]
23 23
24 24 [[package]]
25 25 name = "atty"
26 26 version = "0.2.14"
27 27 source = "registry+https://github.com/rust-lang/crates.io-index"
28 28 dependencies = [
29 29 "hermit-abi 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
30 30 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
31 31 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
32 32 ]
33 33
34 34 [[package]]
35 35 name = "autocfg"
36 36 version = "1.0.1"
37 37 source = "registry+https://github.com/rust-lang/crates.io-index"
38 38
39 39 [[package]]
40 40 name = "bitflags"
41 41 version = "1.2.1"
42 42 source = "registry+https://github.com/rust-lang/crates.io-index"
43 43
44 44 [[package]]
45 45 name = "bitmaps"
46 46 version = "2.1.0"
47 47 source = "registry+https://github.com/rust-lang/crates.io-index"
48 48 dependencies = [
49 49 "typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
50 50 ]
51 51
52 52 [[package]]
53 53 name = "byteorder"
54 54 version = "1.3.4"
55 55 source = "registry+https://github.com/rust-lang/crates.io-index"
56 56
57 57 [[package]]
58 58 name = "cc"
59 59 version = "1.0.60"
60 60 source = "registry+https://github.com/rust-lang/crates.io-index"
61 61 dependencies = [
62 62 "jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
63 63 ]
64 64
65 65 [[package]]
66 66 name = "cfg-if"
67 67 version = "0.1.10"
68 68 source = "registry+https://github.com/rust-lang/crates.io-index"
69 69
70 70 [[package]]
71 71 name = "clap"
72 72 version = "2.33.3"
73 73 source = "registry+https://github.com/rust-lang/crates.io-index"
74 74 dependencies = [
75 75 "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
76 76 "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
77 77 "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
78 78 "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
79 79 "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
80 80 "unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
81 81 "vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
82 82 ]
83 83
84 84 [[package]]
85 85 name = "cpython"
86 86 version = "0.4.1"
87 87 source = "registry+https://github.com/rust-lang/crates.io-index"
88 88 dependencies = [
89 89 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
90 90 "num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
91 91 "python27-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
92 92 "python3-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
93 93 ]
94 94
95 95 [[package]]
96 96 name = "crc32fast"
97 97 version = "1.2.0"
98 98 source = "registry+https://github.com/rust-lang/crates.io-index"
99 99 dependencies = [
100 100 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
101 101 ]
102 102
103 103 [[package]]
104 104 name = "crossbeam"
105 105 version = "0.7.3"
106 106 source = "registry+https://github.com/rust-lang/crates.io-index"
107 107 dependencies = [
108 108 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
109 109 "crossbeam-channel 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
110 110 "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
111 111 "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
112 112 "crossbeam-queue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
113 113 "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
114 114 ]
115 115
116 116 [[package]]
117 117 name = "crossbeam-channel"
118 118 version = "0.4.4"
119 119 source = "registry+https://github.com/rust-lang/crates.io-index"
120 120 dependencies = [
121 121 "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
122 122 "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
123 123 ]
124 124
125 125 [[package]]
126 126 name = "crossbeam-deque"
127 127 version = "0.7.3"
128 128 source = "registry+https://github.com/rust-lang/crates.io-index"
129 129 dependencies = [
130 130 "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
131 131 "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
132 132 "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
133 133 ]
134 134
135 135 [[package]]
136 136 name = "crossbeam-epoch"
137 137 version = "0.8.2"
138 138 source = "registry+https://github.com/rust-lang/crates.io-index"
139 139 dependencies = [
140 140 "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
141 141 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
142 142 "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
143 143 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
144 144 "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
145 145 "memoffset 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
146 146 "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
147 147 ]
148 148
149 149 [[package]]
150 150 name = "crossbeam-queue"
151 151 version = "0.2.3"
152 152 source = "registry+https://github.com/rust-lang/crates.io-index"
153 153 dependencies = [
154 154 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
155 155 "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
156 156 "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
157 157 ]
158 158
159 159 [[package]]
160 160 name = "crossbeam-utils"
161 161 version = "0.7.2"
162 162 source = "registry+https://github.com/rust-lang/crates.io-index"
163 163 dependencies = [
164 164 "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
165 165 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
166 166 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
167 167 ]
168 168
169 169 [[package]]
170 170 name = "ctor"
171 171 version = "0.1.16"
172 172 source = "registry+https://github.com/rust-lang/crates.io-index"
173 173 dependencies = [
174 174 "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
175 175 "syn 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
176 176 ]
177 177
178 178 [[package]]
179 179 name = "difference"
180 180 version = "2.0.0"
181 181 source = "registry+https://github.com/rust-lang/crates.io-index"
182 182
183 183 [[package]]
184 184 name = "either"
185 185 version = "1.6.1"
186 186 source = "registry+https://github.com/rust-lang/crates.io-index"
187 187
188 188 [[package]]
189 189 name = "env_logger"
190 190 version = "0.7.1"
191 191 source = "registry+https://github.com/rust-lang/crates.io-index"
192 192 dependencies = [
193 193 "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
194 194 "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
195 195 "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
196 196 "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
197 197 "termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
198 198 ]
199 199
200 200 [[package]]
201 201 name = "flate2"
202 202 version = "1.0.17"
203 203 source = "registry+https://github.com/rust-lang/crates.io-index"
204 204 dependencies = [
205 205 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
206 206 "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
207 207 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
208 208 "libz-sys 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
209 209 "miniz_oxide 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
210 210 ]
211 211
212 212 [[package]]
213 name = "format-bytes"
214 version = "0.1.3"
215 source = "registry+https://github.com/rust-lang/crates.io-index"
216 dependencies = [
217 "format-bytes-macros 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
218 "proc-macro-hack 0.5.19 (registry+https://github.com/rust-lang/crates.io-index)",
219 ]
220
221 [[package]]
222 name = "format-bytes-macros"
223 version = "0.1.2"
224 source = "registry+https://github.com/rust-lang/crates.io-index"
225 dependencies = [
226 "proc-macro-hack 0.5.19 (registry+https://github.com/rust-lang/crates.io-index)",
227 "proc-macro2 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
228 "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
229 "syn 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
230 ]
231
232 [[package]]
213 233 name = "fuchsia-cprng"
214 234 version = "0.1.1"
215 235 source = "registry+https://github.com/rust-lang/crates.io-index"
216 236
217 237 [[package]]
218 238 name = "gcc"
219 239 version = "0.3.55"
220 240 source = "registry+https://github.com/rust-lang/crates.io-index"
221 241
222 242 [[package]]
223 243 name = "getrandom"
224 244 version = "0.1.15"
225 245 source = "registry+https://github.com/rust-lang/crates.io-index"
226 246 dependencies = [
227 247 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
228 248 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
229 249 "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)",
230 250 ]
231 251
232 252 [[package]]
233 253 name = "glob"
234 254 version = "0.3.0"
235 255 source = "registry+https://github.com/rust-lang/crates.io-index"
236 256
237 257 [[package]]
238 258 name = "hermit-abi"
239 259 version = "0.1.16"
240 260 source = "registry+https://github.com/rust-lang/crates.io-index"
241 261 dependencies = [
242 262 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
243 263 ]
244 264
245 265 [[package]]
246 266 name = "hex"
247 267 version = "0.4.2"
248 268 source = "registry+https://github.com/rust-lang/crates.io-index"
249 269
250 270 [[package]]
251 271 name = "hg-core"
252 272 version = "0.1.0"
253 273 dependencies = [
254 274 "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
255 275 "clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)",
256 276 "crossbeam 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
257 277 "flate2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
258 278 "hex 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
259 279 "im-rc 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
260 280 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
261 281 "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
262 282 "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
263 283 "memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
264 284 "micro-timer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
265 285 "pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
266 286 "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
267 287 "rand_distr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
268 288 "rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
269 289 "rayon 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
270 290 "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
271 291 "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
272 292 "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
273 293 "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
274 294 "twox-hash 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
275 295 "zstd 0.5.3+zstd.1.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
276 296 ]
277 297
278 298 [[package]]
279 299 name = "hg-cpython"
280 300 version = "0.1.0"
281 301 dependencies = [
282 302 "cpython 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
283 303 "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
284 304 "hg-core 0.1.0",
285 305 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
286 306 "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
287 307 ]
288 308
289 309 [[package]]
290 310 name = "humantime"
291 311 version = "1.3.0"
292 312 source = "registry+https://github.com/rust-lang/crates.io-index"
293 313 dependencies = [
294 314 "quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
295 315 ]
296 316
297 317 [[package]]
298 318 name = "im-rc"
299 319 version = "15.0.0"
300 320 source = "registry+https://github.com/rust-lang/crates.io-index"
301 321 dependencies = [
302 322 "bitmaps 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
303 323 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
304 324 "rand_xoshiro 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
305 325 "sized-chunks 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
306 326 "typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
307 327 "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
308 328 ]
309 329
310 330 [[package]]
311 331 name = "itertools"
312 332 version = "0.9.0"
313 333 source = "registry+https://github.com/rust-lang/crates.io-index"
314 334 dependencies = [
315 335 "either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
316 336 ]
317 337
318 338 [[package]]
319 339 name = "jobserver"
320 340 version = "0.1.21"
321 341 source = "registry+https://github.com/rust-lang/crates.io-index"
322 342 dependencies = [
323 343 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
324 344 ]
325 345
326 346 [[package]]
327 347 name = "lazy_static"
328 348 version = "1.4.0"
329 349 source = "registry+https://github.com/rust-lang/crates.io-index"
330 350
331 351 [[package]]
332 352 name = "libc"
333 353 version = "0.2.77"
334 354 source = "registry+https://github.com/rust-lang/crates.io-index"
335 355
336 356 [[package]]
337 357 name = "libz-sys"
338 358 version = "1.1.2"
339 359 source = "registry+https://github.com/rust-lang/crates.io-index"
340 360 dependencies = [
341 361 "cc 1.0.60 (registry+https://github.com/rust-lang/crates.io-index)",
342 362 "pkg-config 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
343 363 "vcpkg 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
344 364 ]
345 365
346 366 [[package]]
347 367 name = "log"
348 368 version = "0.4.11"
349 369 source = "registry+https://github.com/rust-lang/crates.io-index"
350 370 dependencies = [
351 371 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
352 372 ]
353 373
354 374 [[package]]
355 375 name = "maybe-uninit"
356 376 version = "2.0.0"
357 377 source = "registry+https://github.com/rust-lang/crates.io-index"
358 378
359 379 [[package]]
360 380 name = "memchr"
361 381 version = "2.3.3"
362 382 source = "registry+https://github.com/rust-lang/crates.io-index"
363 383
364 384 [[package]]
365 385 name = "memmap"
366 386 version = "0.7.0"
367 387 source = "registry+https://github.com/rust-lang/crates.io-index"
368 388 dependencies = [
369 389 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
370 390 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
371 391 ]
372 392
373 393 [[package]]
374 394 name = "memoffset"
375 395 version = "0.5.6"
376 396 source = "registry+https://github.com/rust-lang/crates.io-index"
377 397 dependencies = [
378 398 "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
379 399 ]
380 400
381 401 [[package]]
382 402 name = "micro-timer"
383 403 version = "0.3.1"
384 404 source = "registry+https://github.com/rust-lang/crates.io-index"
385 405 dependencies = [
386 406 "micro-timer-macros 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
387 407 "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
388 408 ]
389 409
390 410 [[package]]
391 411 name = "micro-timer-macros"
392 412 version = "0.3.1"
393 413 source = "registry+https://github.com/rust-lang/crates.io-index"
394 414 dependencies = [
395 415 "proc-macro2 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
396 416 "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
397 417 "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
398 418 "syn 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)",
399 419 ]
400 420
401 421 [[package]]
402 422 name = "miniz_oxide"
403 423 version = "0.4.2"
404 424 source = "registry+https://github.com/rust-lang/crates.io-index"
405 425 dependencies = [
406 426 "adler 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
407 427 "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
408 428 ]
409 429
410 430 [[package]]
411 431 name = "num-traits"
412 432 version = "0.2.12"
413 433 source = "registry+https://github.com/rust-lang/crates.io-index"
414 434 dependencies = [
415 435 "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
416 436 ]
417 437
418 438 [[package]]
419 439 name = "num_cpus"
420 440 version = "1.13.0"
421 441 source = "registry+https://github.com/rust-lang/crates.io-index"
422 442 dependencies = [
423 443 "hermit-abi 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
424 444 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
425 445 ]
426 446
427 447 [[package]]
428 448 name = "output_vt100"
429 449 version = "0.1.2"
430 450 source = "registry+https://github.com/rust-lang/crates.io-index"
431 451 dependencies = [
432 452 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
433 453 ]
434 454
435 455 [[package]]
436 456 name = "pkg-config"
437 457 version = "0.3.18"
438 458 source = "registry+https://github.com/rust-lang/crates.io-index"
439 459
440 460 [[package]]
441 461 name = "ppv-lite86"
442 462 version = "0.2.9"
443 463 source = "registry+https://github.com/rust-lang/crates.io-index"
444 464
445 465 [[package]]
446 466 name = "pretty_assertions"
447 467 version = "0.6.1"
448 468 source = "registry+https://github.com/rust-lang/crates.io-index"
449 469 dependencies = [
450 470 "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
451 471 "ctor 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
452 472 "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
453 473 "output_vt100 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
454 474 ]
455 475
456 476 [[package]]
477 name = "proc-macro-hack"
478 version = "0.5.19"
479 source = "registry+https://github.com/rust-lang/crates.io-index"
480
481 [[package]]
457 482 name = "proc-macro2"
458 483 version = "1.0.21"
459 484 source = "registry+https://github.com/rust-lang/crates.io-index"
460 485 dependencies = [
461 486 "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
462 487 ]
463 488
464 489 [[package]]
465 490 name = "python27-sys"
466 491 version = "0.4.1"
467 492 source = "registry+https://github.com/rust-lang/crates.io-index"
468 493 dependencies = [
469 494 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
470 495 "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
471 496 ]
472 497
473 498 [[package]]
474 499 name = "python3-sys"
475 500 version = "0.4.1"
476 501 source = "registry+https://github.com/rust-lang/crates.io-index"
477 502 dependencies = [
478 503 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
479 504 "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
480 505 ]
481 506
482 507 [[package]]
483 508 name = "quick-error"
484 509 version = "1.2.3"
485 510 source = "registry+https://github.com/rust-lang/crates.io-index"
486 511
487 512 [[package]]
488 513 name = "quote"
489 514 version = "1.0.7"
490 515 source = "registry+https://github.com/rust-lang/crates.io-index"
491 516 dependencies = [
492 517 "proc-macro2 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
493 518 ]
494 519
495 520 [[package]]
496 521 name = "rand"
497 522 version = "0.3.23"
498 523 source = "registry+https://github.com/rust-lang/crates.io-index"
499 524 dependencies = [
500 525 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
501 526 "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
502 527 ]
503 528
504 529 [[package]]
505 530 name = "rand"
506 531 version = "0.4.6"
507 532 source = "registry+https://github.com/rust-lang/crates.io-index"
508 533 dependencies = [
509 534 "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
510 535 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
511 536 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
512 537 "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
513 538 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
514 539 ]
515 540
516 541 [[package]]
517 542 name = "rand"
518 543 version = "0.7.3"
519 544 source = "registry+https://github.com/rust-lang/crates.io-index"
520 545 dependencies = [
521 546 "getrandom 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
522 547 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
523 548 "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
524 549 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
525 550 "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
526 551 ]
527 552
528 553 [[package]]
529 554 name = "rand_chacha"
530 555 version = "0.2.2"
531 556 source = "registry+https://github.com/rust-lang/crates.io-index"
532 557 dependencies = [
533 558 "ppv-lite86 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
534 559 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
535 560 ]
536 561
537 562 [[package]]
538 563 name = "rand_core"
539 564 version = "0.3.1"
540 565 source = "registry+https://github.com/rust-lang/crates.io-index"
541 566 dependencies = [
542 567 "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
543 568 ]
544 569
545 570 [[package]]
546 571 name = "rand_core"
547 572 version = "0.4.2"
548 573 source = "registry+https://github.com/rust-lang/crates.io-index"
549 574
550 575 [[package]]
551 576 name = "rand_core"
552 577 version = "0.5.1"
553 578 source = "registry+https://github.com/rust-lang/crates.io-index"
554 579 dependencies = [
555 580 "getrandom 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
556 581 ]
557 582
558 583 [[package]]
559 584 name = "rand_distr"
560 585 version = "0.2.2"
561 586 source = "registry+https://github.com/rust-lang/crates.io-index"
562 587 dependencies = [
563 588 "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
564 589 ]
565 590
566 591 [[package]]
567 592 name = "rand_hc"
568 593 version = "0.2.0"
569 594 source = "registry+https://github.com/rust-lang/crates.io-index"
570 595 dependencies = [
571 596 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
572 597 ]
573 598
574 599 [[package]]
575 600 name = "rand_pcg"
576 601 version = "0.2.1"
577 602 source = "registry+https://github.com/rust-lang/crates.io-index"
578 603 dependencies = [
579 604 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
580 605 ]
581 606
582 607 [[package]]
583 608 name = "rand_xoshiro"
584 609 version = "0.4.0"
585 610 source = "registry+https://github.com/rust-lang/crates.io-index"
586 611 dependencies = [
587 612 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
588 613 ]
589 614
590 615 [[package]]
591 616 name = "rayon"
592 617 version = "1.4.0"
593 618 source = "registry+https://github.com/rust-lang/crates.io-index"
594 619 dependencies = [
595 620 "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
596 621 "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
597 622 "either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
598 623 "rayon-core 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
599 624 ]
600 625
601 626 [[package]]
602 627 name = "rayon-core"
603 628 version = "1.8.1"
604 629 source = "registry+https://github.com/rust-lang/crates.io-index"
605 630 dependencies = [
606 631 "crossbeam-channel 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
607 632 "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
608 633 "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
609 634 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
610 635 "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
611 636 ]
612 637
613 638 [[package]]
614 639 name = "rdrand"
615 640 version = "0.4.0"
616 641 source = "registry+https://github.com/rust-lang/crates.io-index"
617 642 dependencies = [
618 643 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
619 644 ]
620 645
621 646 [[package]]
622 647 name = "redox_syscall"
623 648 version = "0.1.57"
624 649 source = "registry+https://github.com/rust-lang/crates.io-index"
625 650
626 651 [[package]]
627 652 name = "regex"
628 653 version = "1.3.9"
629 654 source = "registry+https://github.com/rust-lang/crates.io-index"
630 655 dependencies = [
631 656 "aho-corasick 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
632 657 "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
633 658 "regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)",
634 659 "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
635 660 ]
636 661
637 662 [[package]]
638 663 name = "regex-syntax"
639 664 version = "0.6.18"
640 665 source = "registry+https://github.com/rust-lang/crates.io-index"
641 666
642 667 [[package]]
643 668 name = "remove_dir_all"
644 669 version = "0.5.3"
645 670 source = "registry+https://github.com/rust-lang/crates.io-index"
646 671 dependencies = [
647 672 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
648 673 ]
649 674
650 675 [[package]]
651 676 name = "rhg"
652 677 version = "0.1.0"
653 678 dependencies = [
654 679 "clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)",
655 680 "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
681 "format-bytes 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
656 682 "hg-core 0.1.0",
657 683 "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
658 684 "micro-timer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
659 685 ]
660 686
661 687 [[package]]
662 688 name = "rust-crypto"
663 689 version = "0.2.36"
664 690 source = "registry+https://github.com/rust-lang/crates.io-index"
665 691 dependencies = [
666 692 "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)",
667 693 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
668 694 "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)",
669 695 "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
670 696 "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
671 697 ]
672 698
673 699 [[package]]
674 700 name = "rustc-serialize"
675 701 version = "0.3.24"
676 702 source = "registry+https://github.com/rust-lang/crates.io-index"
677 703
678 704 [[package]]
679 705 name = "same-file"
680 706 version = "1.0.6"
681 707 source = "registry+https://github.com/rust-lang/crates.io-index"
682 708 dependencies = [
683 709 "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
684 710 ]
685 711
686 712 [[package]]
687 713 name = "scopeguard"
688 714 version = "1.1.0"
689 715 source = "registry+https://github.com/rust-lang/crates.io-index"
690 716
691 717 [[package]]
692 718 name = "sized-chunks"
693 719 version = "0.6.2"
694 720 source = "registry+https://github.com/rust-lang/crates.io-index"
695 721 dependencies = [
696 722 "bitmaps 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
697 723 "typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
698 724 ]
699 725
700 726 [[package]]
701 727 name = "strsim"
702 728 version = "0.8.0"
703 729 source = "registry+https://github.com/rust-lang/crates.io-index"
704 730
705 731 [[package]]
706 732 name = "syn"
707 733 version = "1.0.41"
708 734 source = "registry+https://github.com/rust-lang/crates.io-index"
709 735 dependencies = [
710 736 "proc-macro2 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
711 737 "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
712 738 "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
713 739 ]
714 740
715 741 [[package]]
716 742 name = "tempfile"
717 743 version = "3.1.0"
718 744 source = "registry+https://github.com/rust-lang/crates.io-index"
719 745 dependencies = [
720 746 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
721 747 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
722 748 "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
723 749 "redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)",
724 750 "remove_dir_all 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
725 751 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
726 752 ]
727 753
728 754 [[package]]
729 755 name = "termcolor"
730 756 version = "1.1.0"
731 757 source = "registry+https://github.com/rust-lang/crates.io-index"
732 758 dependencies = [
733 759 "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
734 760 ]
735 761
736 762 [[package]]
737 763 name = "textwrap"
738 764 version = "0.11.0"
739 765 source = "registry+https://github.com/rust-lang/crates.io-index"
740 766 dependencies = [
741 767 "unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
742 768 ]
743 769
744 770 [[package]]
745 771 name = "thread_local"
746 772 version = "1.0.1"
747 773 source = "registry+https://github.com/rust-lang/crates.io-index"
748 774 dependencies = [
749 775 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
750 776 ]
751 777
752 778 [[package]]
753 779 name = "time"
754 780 version = "0.1.44"
755 781 source = "registry+https://github.com/rust-lang/crates.io-index"
756 782 dependencies = [
757 783 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
758 784 "wasi 0.10.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)",
759 785 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
760 786 ]
761 787
762 788 [[package]]
763 789 name = "twox-hash"
764 790 version = "1.5.0"
765 791 source = "registry+https://github.com/rust-lang/crates.io-index"
766 792 dependencies = [
767 793 "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
768 794 ]
769 795
770 796 [[package]]
771 797 name = "typenum"
772 798 version = "1.12.0"
773 799 source = "registry+https://github.com/rust-lang/crates.io-index"
774 800
775 801 [[package]]
776 802 name = "unicode-width"
777 803 version = "0.1.8"
778 804 source = "registry+https://github.com/rust-lang/crates.io-index"
779 805
780 806 [[package]]
781 807 name = "unicode-xid"
782 808 version = "0.2.1"
783 809 source = "registry+https://github.com/rust-lang/crates.io-index"
784 810
785 811 [[package]]
786 812 name = "vcpkg"
787 813 version = "0.2.10"
788 814 source = "registry+https://github.com/rust-lang/crates.io-index"
789 815
790 816 [[package]]
791 817 name = "vec_map"
792 818 version = "0.8.2"
793 819 source = "registry+https://github.com/rust-lang/crates.io-index"
794 820
795 821 [[package]]
796 822 name = "version_check"
797 823 version = "0.9.1"
798 824 source = "registry+https://github.com/rust-lang/crates.io-index"
799 825
800 826 [[package]]
801 827 name = "wasi"
802 828 version = "0.9.0+wasi-snapshot-preview1"
803 829 source = "registry+https://github.com/rust-lang/crates.io-index"
804 830
805 831 [[package]]
806 832 name = "wasi"
807 833 version = "0.10.0+wasi-snapshot-preview1"
808 834 source = "registry+https://github.com/rust-lang/crates.io-index"
809 835
810 836 [[package]]
811 837 name = "winapi"
812 838 version = "0.3.9"
813 839 source = "registry+https://github.com/rust-lang/crates.io-index"
814 840 dependencies = [
815 841 "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
816 842 "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
817 843 ]
818 844
819 845 [[package]]
820 846 name = "winapi-i686-pc-windows-gnu"
821 847 version = "0.4.0"
822 848 source = "registry+https://github.com/rust-lang/crates.io-index"
823 849
824 850 [[package]]
825 851 name = "winapi-util"
826 852 version = "0.1.5"
827 853 source = "registry+https://github.com/rust-lang/crates.io-index"
828 854 dependencies = [
829 855 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
830 856 ]
831 857
832 858 [[package]]
833 859 name = "winapi-x86_64-pc-windows-gnu"
834 860 version = "0.4.0"
835 861 source = "registry+https://github.com/rust-lang/crates.io-index"
836 862
837 863 [[package]]
838 864 name = "zstd"
839 865 version = "0.5.3+zstd.1.4.5"
840 866 source = "registry+https://github.com/rust-lang/crates.io-index"
841 867 dependencies = [
842 868 "zstd-safe 2.0.5+zstd.1.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
843 869 ]
844 870
845 871 [[package]]
846 872 name = "zstd-safe"
847 873 version = "2.0.5+zstd.1.4.5"
848 874 source = "registry+https://github.com/rust-lang/crates.io-index"
849 875 dependencies = [
850 876 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
851 877 "zstd-sys 1.4.17+zstd.1.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
852 878 ]
853 879
854 880 [[package]]
855 881 name = "zstd-sys"
856 882 version = "1.4.17+zstd.1.4.5"
857 883 source = "registry+https://github.com/rust-lang/crates.io-index"
858 884 dependencies = [
859 885 "cc 1.0.60 (registry+https://github.com/rust-lang/crates.io-index)",
860 886 "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
861 887 "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
862 888 "libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)",
863 889 ]
864 890
865 891 [metadata]
866 892 "checksum adler 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
867 893 "checksum aho-corasick 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)" = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86"
868 894 "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
869 895 "checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
870 896 "checksum autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
871 897 "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
872 898 "checksum bitmaps 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2"
873 899 "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
874 900 "checksum cc 1.0.60 (registry+https://github.com/rust-lang/crates.io-index)" = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c"
875 901 "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
876 902 "checksum clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)" = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
877 903 "checksum cpython 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bfaf3847ab963e40c4f6dd8d6be279bdf74007ae2413786a0dcbb28c52139a95"
878 904 "checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
879 905 "checksum crossbeam 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e"
880 906 "checksum crossbeam-channel 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87"
881 907 "checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285"
882 908 "checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace"
883 909 "checksum crossbeam-queue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570"
884 910 "checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
885 911 "checksum ctor 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "7fbaabec2c953050352311293be5c6aba8e141ba19d6811862b232d6fd020484"
886 912 "checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
887 913 "checksum either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
888 914 "checksum env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
889 915 "checksum flate2 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "766d0e77a2c1502169d4a93ff3b8c15a71fd946cd0126309752104e5f3c46d94"
916 "checksum format-bytes 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1a7374eb574cd29ae45878554298091c554c3286a17b3afa440a3e2710ae0790"
917 "checksum format-bytes-macros 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4edcc04201cea17a0e6b937adebd46b93fba09924c7e6ed8c515a35ce8432cbc"
890 918 "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
891 919 "checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2"
892 920 "checksum getrandom 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
893 921 "checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
894 922 "checksum hermit-abi 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151"
895 923 "checksum hex 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35"
896 924 "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
897 925 "checksum im-rc 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca8957e71f04a205cb162508f9326aea04676c8dfd0711220190d6b83664f3f"
898 926 "checksum itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
899 927 "checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2"
900 928 "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
901 929 "checksum libc 0.2.77 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235"
902 930 "checksum libz-sys 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655"
903 931 "checksum log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
904 932 "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
905 933 "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
906 934 "checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
907 935 "checksum memoffset 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa"
908 936 "checksum micro-timer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2620153e1d903d26b72b89f0e9c48d8c4756cba941c185461dddc234980c298c"
909 937 "checksum micro-timer-macros 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e28a3473e6abd6e9aab36aaeef32ad22ae0bd34e79f376643594c2b152ec1c5d"
910 938 "checksum miniz_oxide 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9"
911 939 "checksum num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611"
912 940 "checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
913 941 "checksum output_vt100 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9"
914 942 "checksum pkg-config 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)" = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33"
915 943 "checksum ppv-lite86 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20"
916 944 "checksum pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427"
945 "checksum proc-macro-hack 0.5.19 (registry+https://github.com/rust-lang/crates.io-index)" = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
917 946 "checksum proc-macro2 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "36e28516df94f3dd551a587da5357459d9b36d945a7c37c3557928c1c2ff2a2c"
918 947 "checksum python27-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "67cb041de8615111bf224dd75667af5f25c6e032118251426fed7f1b70ce4c8c"
919 948 "checksum python3-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90af11779515a1e530af60782d273b59ac79d33b0e253c071a728563957c76d4"
920 949 "checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
921 950 "checksum quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
922 951 "checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c"
923 952 "checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"
924 953 "checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
925 954 "checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
926 955 "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
927 956 "checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
928 957 "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
929 958 "checksum rand_distr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96977acbdd3a6576fb1d27391900035bf3863d4a16422973a409b488cf29ffb2"
930 959 "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
931 960 "checksum rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429"
932 961 "checksum rand_xoshiro 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9fcdd2e881d02f1d9390ae47ad8e5696a9e4be7b547a1da2afbc61973217004"
933 962 "checksum rayon 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cfd016f0c045ad38b5251be2c9c0ab806917f82da4d36b2a327e5166adad9270"
934 963 "checksum rayon-core 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e8c4fec834fb6e6d2dd5eece3c7b432a52f0ba887cf40e595190c4107edc08bf"
935 964 "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
936 965 "checksum redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)" = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
937 966 "checksum regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6"
938 967 "checksum regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)" = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
939 968 "checksum remove_dir_all 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
940 969 "checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a"
941 970 "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
942 971 "checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
943 972 "checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
944 973 "checksum sized-chunks 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1ec31ceca5644fa6d444cc77548b88b67f46db6f7c71683b0f9336e671830d2f"
945 974 "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
946 975 "checksum syn 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)" = "6690e3e9f692504b941dc6c3b188fd28df054f7fb8469ab40680df52fdcc842b"
947 976 "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9"
948 977 "checksum termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f"
949 978 "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
950 979 "checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
951 980 "checksum time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
952 981 "checksum twox-hash 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56"
953 982 "checksum typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"
954 983 "checksum unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
955 984 "checksum unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
956 985 "checksum vcpkg 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
957 986 "checksum vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
958 987 "checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce"
959 988 "checksum wasi 0.10.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
960 989 "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
961 990 "checksum winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
962 991 "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
963 992 "checksum winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
964 993 "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
965 994 "checksum zstd 0.5.3+zstd.1.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01b32eaf771efa709e8308605bbf9319bf485dc1503179ec0469b611937c0cd8"
966 995 "checksum zstd-safe 2.0.5+zstd.1.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1cfb642e0d27f64729a639c52db457e0ae906e7bc6f5fe8f5c453230400f1055"
967 996 "checksum zstd-sys 1.4.17+zstd.1.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b89249644df056b522696b1bb9e7c18c87e8ffa3e2f0dc3b0155875d6498f01b"
@@ -1,12 +1,16 b''
1 1 [package]
2 2 name = "rhg"
3 3 version = "0.1.0"
4 authors = ["Antoine Cezar <antoine.cezar@octobus.net>"]
4 authors = [
5 "Antoine Cezar <antoine.cezar@octobus.net>",
6 "Raphaël Gomès <raphael.gomes@octobus.net>",
7 ]
5 8 edition = "2018"
6 9
7 10 [dependencies]
8 11 hg-core = { path = "../hg-core"}
9 12 clap = "2.33.1"
10 13 log = "0.4.11"
11 14 micro-timer = "0.3.1"
12 15 env_logger = "0.7.1"
16 format-bytes = "0.1.3"
@@ -1,32 +1,32 b''
1 1 use crate::commands::Command;
2 2 use crate::error::CommandError;
3 3 use crate::ui::Ui;
4 use format_bytes::format_bytes;
4 5 use hg::operations::FindRoot;
5 6 use hg::utils::files::get_bytes_from_path;
6 7
7 8 pub const HELP_TEXT: &str = "
8 9 Print the root directory of the current repository.
9 10
10 11 Returns 0 on success.
11 12 ";
12 13
13 14 pub struct RootCommand {}
14 15
15 16 impl RootCommand {
16 17 pub fn new() -> Self {
17 18 RootCommand {}
18 19 }
19 20 }
20 21
21 22 impl Command for RootCommand {
22 23 fn run(&self, ui: &Ui) -> Result<(), CommandError> {
23 24 let path_buf = FindRoot::new().run()?;
24 25
25 26 let bytes = get_bytes_from_path(path_buf);
26 27
27 // TODO use formating macro
28 ui.write_stdout(&[bytes.as_slice(), b"\n"].concat())?;
28 ui.write_stdout(&format_bytes!(b"{}\n", bytes.as_slice()))?;
29 29
30 30 Ok(())
31 31 }
32 32 }
@@ -1,133 +1,124 b''
1 1 use crate::exitcode;
2 2 use crate::ui::UiError;
3 use format_bytes::format_bytes;
3 4 use hg::operations::{FindRootError, FindRootErrorKind};
4 5 use hg::requirements::RequirementsError;
5 6 use hg::utils::files::get_bytes_from_path;
6 7 use std::convert::From;
7 8 use std::path::PathBuf;
8 9
9 10 /// The kind of command error
10 11 #[derive(Debug)]
11 12 pub enum CommandErrorKind {
12 13 /// The root of the repository cannot be found
13 14 RootNotFound(PathBuf),
14 15 /// The current directory cannot be found
15 16 CurrentDirNotFound(std::io::Error),
16 17 /// `.hg/requires`
17 18 RequirementsError(RequirementsError),
18 19 /// The standard output stream cannot be written to
19 20 StdoutError,
20 21 /// The standard error stream cannot be written to
21 22 StderrError,
22 23 /// The command aborted
23 24 Abort(Option<Vec<u8>>),
24 25 /// A mercurial capability as not been implemented.
25 26 Unimplemented,
26 27 }
27 28
28 29 impl CommandErrorKind {
29 30 pub fn get_exit_code(&self) -> exitcode::ExitCode {
30 31 match self {
31 32 CommandErrorKind::RootNotFound(_) => exitcode::ABORT,
32 33 CommandErrorKind::CurrentDirNotFound(_) => exitcode::ABORT,
33 34 CommandErrorKind::RequirementsError(
34 35 RequirementsError::Unsupported { .. },
35 36 ) => exitcode::UNIMPLEMENTED_COMMAND,
36 37 CommandErrorKind::RequirementsError(_) => exitcode::ABORT,
37 38 CommandErrorKind::StdoutError => exitcode::ABORT,
38 39 CommandErrorKind::StderrError => exitcode::ABORT,
39 40 CommandErrorKind::Abort(_) => exitcode::ABORT,
40 41 CommandErrorKind::Unimplemented => exitcode::UNIMPLEMENTED_COMMAND,
41 42 }
42 43 }
43 44
44 45 /// Return the message corresponding to the error kind if any
45 46 pub fn get_error_message_bytes(&self) -> Option<Vec<u8>> {
46 47 match self {
47 // TODO use formating macro
48 48 CommandErrorKind::RootNotFound(path) => {
49 49 let bytes = get_bytes_from_path(path);
50 Some(
51 [
52 b"abort: no repository found in '",
53 bytes.as_slice(),
54 b"' (.hg not found)!\n",
55 ]
56 .concat(),
57 )
50 Some(format_bytes!(
51 b"abort: no repository found in '{}' (.hg not found)!\n",
52 bytes.as_slice()
53 ))
58 54 }
59 // TODO use formating macro
60 CommandErrorKind::CurrentDirNotFound(e) => Some(
61 [
62 b"abort: error getting current working directory: ",
63 e.to_string().as_bytes(),
64 b"\n",
65 ]
66 .concat(),
67 ),
55 CommandErrorKind::CurrentDirNotFound(e) => Some(format_bytes!(
56 b"abort: error getting current working directory: {}\n",
57 e.to_string().as_bytes(),
58 )),
68 59 CommandErrorKind::RequirementsError(
69 60 RequirementsError::Corrupted,
70 61 ) => Some(
71 62 "abort: .hg/requires is corrupted\n".as_bytes().to_owned(),
72 63 ),
73 64 CommandErrorKind::Abort(message) => message.to_owned(),
74 65 _ => None,
75 66 }
76 67 }
77 68 }
78 69
79 70 /// The error type for the Command trait
80 71 #[derive(Debug)]
81 72 pub struct CommandError {
82 73 pub kind: CommandErrorKind,
83 74 }
84 75
85 76 impl CommandError {
86 77 /// Exist the process with the corresponding exit code.
87 78 pub fn exit(&self) {
88 79 std::process::exit(self.kind.get_exit_code())
89 80 }
90 81
91 82 /// Return the message corresponding to the command error if any
92 83 pub fn get_error_message_bytes(&self) -> Option<Vec<u8>> {
93 84 self.kind.get_error_message_bytes()
94 85 }
95 86 }
96 87
97 88 impl From<CommandErrorKind> for CommandError {
98 89 fn from(kind: CommandErrorKind) -> Self {
99 90 CommandError { kind }
100 91 }
101 92 }
102 93
103 94 impl From<UiError> for CommandError {
104 95 fn from(error: UiError) -> Self {
105 96 CommandError {
106 97 kind: match error {
107 98 UiError::StdoutError(_) => CommandErrorKind::StdoutError,
108 99 UiError::StderrError(_) => CommandErrorKind::StderrError,
109 100 },
110 101 }
111 102 }
112 103 }
113 104
114 105 impl From<FindRootError> for CommandError {
115 106 fn from(err: FindRootError) -> Self {
116 107 match err.kind {
117 108 FindRootErrorKind::RootNotFound(path) => CommandError {
118 109 kind: CommandErrorKind::RootNotFound(path),
119 110 },
120 111 FindRootErrorKind::GetCurrentDirError(e) => CommandError {
121 112 kind: CommandErrorKind::CurrentDirNotFound(e),
122 113 },
123 114 }
124 115 }
125 116 }
126 117
127 118 impl From<RequirementsError> for CommandError {
128 119 fn from(err: RequirementsError) -> Self {
129 120 CommandError {
130 121 kind: CommandErrorKind::RequirementsError(err),
131 122 }
132 123 }
133 124 }
@@ -1,113 +1,117 b''
1 use format_bytes::format_bytes;
1 2 use std::borrow::Cow;
2 3 use std::io;
3 4 use std::io::{ErrorKind, Write};
4 5
5 6 #[derive(Debug)]
6 7 pub struct Ui {
7 8 stdout: std::io::Stdout,
8 9 stderr: std::io::Stderr,
9 10 }
10 11
11 12 /// The kind of user interface error
12 13 pub enum UiError {
13 14 /// The standard output stream cannot be written to
14 15 StdoutError(io::Error),
15 16 /// The standard error stream cannot be written to
16 17 StderrError(io::Error),
17 18 }
18 19
19 20 /// The commandline user interface
20 21 impl Ui {
21 22 pub fn new() -> Self {
22 23 Ui {
23 24 stdout: std::io::stdout(),
24 25 stderr: std::io::stderr(),
25 26 }
26 27 }
27 28
28 29 /// Returns a buffered handle on stdout for faster batch printing
29 30 /// operations.
30 31 pub fn stdout_buffer(&self) -> StdoutBuffer<std::io::StdoutLock> {
31 32 StdoutBuffer::new(self.stdout.lock())
32 33 }
33 34
34 35 /// Write bytes to stdout
35 36 pub fn write_stdout(&self, bytes: &[u8]) -> Result<(), UiError> {
36 37 let mut stdout = self.stdout.lock();
37 38
38 39 stdout.write_all(bytes).or_else(handle_stdout_error)?;
39 40
40 41 stdout.flush().or_else(handle_stdout_error)
41 42 }
42 43
43 44 /// Write bytes to stderr
44 45 pub fn write_stderr(&self, bytes: &[u8]) -> Result<(), UiError> {
45 46 let mut stderr = self.stderr.lock();
46 47
47 48 stderr.write_all(bytes).or_else(handle_stderr_error)?;
48 49
49 50 stderr.flush().or_else(handle_stderr_error)
50 51 }
51 52
52 53 /// Write string line to stderr
53 54 pub fn writeln_stderr_str(&self, s: &str) -> Result<(), UiError> {
54 55 self.write_stderr(&format!("{}\n", s).as_bytes())
55 56 }
56 57 }
57 58
58 59 /// A buffered stdout writer for faster batch printing operations.
59 60 pub struct StdoutBuffer<W: Write> {
60 61 buf: io::BufWriter<W>,
61 62 }
62 63
63 64 impl<W: Write> StdoutBuffer<W> {
64 65 pub fn new(writer: W) -> Self {
65 66 let buf = io::BufWriter::new(writer);
66 67 Self { buf }
67 68 }
68 69
69 70 /// Write bytes to stdout buffer
70 71 pub fn write_all(&mut self, bytes: &[u8]) -> Result<(), UiError> {
71 72 self.buf.write_all(bytes).or_else(handle_stdout_error)
72 73 }
73 74
74 75 /// Flush bytes to stdout
75 76 pub fn flush(&mut self) -> Result<(), UiError> {
76 77 self.buf.flush().or_else(handle_stdout_error)
77 78 }
78 79 }
79 80
80 81 /// Sometimes writing to stdout is not possible, try writing to stderr to
81 82 /// signal that failure, otherwise just bail.
82 83 fn handle_stdout_error(error: io::Error) -> Result<(), UiError> {
83 84 if let ErrorKind::BrokenPipe = error.kind() {
84 85 // This makes `| head` work for example
85 86 return Ok(());
86 87 }
87 88 let mut stderr = io::stderr();
88 89
89 90 stderr
90 .write_all(&[b"abort: ", error.to_string().as_bytes(), b"\n"].concat())
91 .write_all(&format_bytes!(
92 b"abort: {}\n",
93 error.to_string().as_bytes()
94 ))
91 95 .map_err(UiError::StderrError)?;
92 96
93 97 stderr.flush().map_err(UiError::StderrError)?;
94 98
95 99 Err(UiError::StdoutError(error))
96 100 }
97 101
98 102 /// Sometimes writing to stderr is not possible.
99 103 fn handle_stderr_error(error: io::Error) -> Result<(), UiError> {
100 104 // A broken pipe should not result in a error
101 105 // like with `| head` for example
102 106 if let ErrorKind::BrokenPipe = error.kind() {
103 107 return Ok(());
104 108 }
105 109 Err(UiError::StdoutError(error))
106 110 }
107 111
108 112 /// Encode rust strings according to the user system.
109 113 pub fn utf8_to_local(s: &str) -> Cow<[u8]> {
110 114 // TODO encode for the user's system //
111 115 let bytes = s.as_bytes();
112 116 Cow::Borrowed(bytes)
113 117 }
General Comments 0
You need to be logged in to leave comments. Login now