Mercurial > hg
comparison rust/rhg/src/commands/status.rs @ 48342:10c32e1b892a
rhg: Propogate manifest parse errors instead of panicking
The Rust parser for the manifest file format is an iterator. Now every item
from that iterator is a `Result`, which makes error handling required
in multiple new places.
This makes better recovery on errors possible, compare to a run time panic.
Differential Revision: https://phab.mercurial-scm.org/D11771
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Tue, 23 Nov 2021 18:27:42 +0100 |
parents | f9db8eeb3aec |
children | eb428010aad2 |
comparison
equal
deleted
inserted
replaced
48341:51f26c8088b2 | 48342:10c32e1b892a |
---|---|
277 .get_option(b"commands", b"status.relative")? | 277 .get_option(b"commands", b"status.relative")? |
278 .unwrap_or(relative); | 278 .unwrap_or(relative); |
279 if relative && !ui.plain() { | 279 if relative && !ui.plain() { |
280 relativize_paths( | 280 relativize_paths( |
281 repo, | 281 repo, |
282 paths, | 282 paths.iter().map(Ok), |
283 |path: Cow<[u8]>| -> Result<(), UiError> { | 283 |path: Cow<[u8]>| -> Result<(), UiError> { |
284 ui.write_stdout( | 284 ui.write_stdout( |
285 &[status_prefix, b" ", path.as_ref(), b"\n"].concat(), | 285 &[status_prefix, b" ", path.as_ref(), b"\n"].concat(), |
286 ) | 286 ) |
287 }, | 287 }, |