Mercurial > public > mercurial-scm > hg
diff rust/rhg/src/commands/status.rs @ 52343: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 | 53dc147bc8b0 |
children | 136e74c2bf8f |
line wrap: on
line diff
--- a/rust/rhg/src/commands/status.rs Mon Dec 02 09:45:56 2024 -0500 +++ b/rust/rhg/src/commands/status.rs Tue Nov 26 15:45:11 2024 +0000 @@ -175,10 +175,8 @@ let rev1 = &revs[0]; let rev2 = &revs[1]; - let rev1 = hg::revset::resolve_single(rev1, repo) - .map_err(|e| (e, rev1.as_str()))?; - let rev2 = hg::revset::resolve_single(rev2, repo) - .map_err(|e| (e, rev2.as_str()))?; + let rev1 = hg::revset::resolve_single(rev1, repo)?; + let rev2 = hg::revset::resolve_single(rev2, repo)?; Ok(Some((rev1, rev2))) } @@ -388,9 +386,7 @@ && (display_states.modified || display_states.clean) { let p1 = repo.dirstate_parents()?.p1; - let manifest = repo.manifest_for_node(p1).map_err(|e| { - CommandError::from((e, &*format!("{:x}", p1.short()))) - })?; + let manifest = repo.manifest_for_node(p1)?; let working_directory_vfs = repo.working_directory_vfs(); let store_vfs = repo.store_vfs(); let filelog_open_options = default_revlog_options(