Mercurial > public > mercurial-scm > hg-stable
diff rust/rhg/src/commands/cat.rs @ 52375:393ad2685fb4
rust: make RevlogError AmbiguousPrefix case contain the actual prefix
This brings the work started in `652149ed64f0` to its logical conclusion and
makes the RevlogError self-sufficient so it can be directly converted to
CommandError, without an extra rev text annotation.
Without this change, it's confusing that the extra annotation is ignored in
most-but-not-all cases.
author | Arseniy Alekseyev <aalekseyev@janestreet.com> |
---|---|
date | Tue, 26 Nov 2024 15:45:11 +0000 |
parents | 532e74ad3ff6 |
children | f33f37accb43 |
line wrap: on
line diff
--- a/rust/rhg/src/commands/cat.rs Mon Dec 02 09:45:56 2024 -0500 +++ b/rust/rhg/src/commands/cat.rs Tue Nov 26 15:45:11 2024 +0000 @@ -94,7 +94,7 @@ None => format!("{:x}", repo.dirstate_parents()?.p1), }; - let output = cat(repo, &rev, files).map_err(|e| (e, rev.as_str()))?; + let output = cat(repo, &rev, files)?; for (_file, contents) in output.results { invocation.ui.write_stdout(&contents)?; }