From f2e0836b1e9fb8a01c7fc6bc3027fbae133ed887 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sun, 2 Apr 2023 10:54:45 +0900 Subject: [PATCH] cli: map RevsetError to CommandError early I'm going to split RevsetError into symbol resolution and evaluation errors, and evaluate_revset() is the only place where CLI crate explicitly specifies RevsetError type. --- src/cli_util.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli_util.rs b/src/cli_util.rs index 7ba597be4..e8dc1a457 100644 --- a/src/cli_util.rs +++ b/src/cli_util.rs @@ -865,13 +865,13 @@ impl WorkspaceCommandHelper { pub fn evaluate_revset<'repo>( &'repo self, revset_expression: Rc, - ) -> Result + 'repo>, RevsetError> { + ) -> Result + 'repo>, CommandError> { let revset_expression = resolve_symbols( self.repo.as_ref(), revset_expression, Some(&self.revset_context()), )?; - revset_expression.evaluate(self.repo.as_ref()) + Ok(revset_expression.evaluate(self.repo.as_ref())?) } fn revset_context(&self) -> RevsetWorkspaceContext {