diff --git a/cli/src/command_error.rs b/cli/src/command_error.rs index c9121e85c5d..3b5df4bd76c 100644 --- a/cli/src/command_error.rs +++ b/cli/src/command_error.rs @@ -466,7 +466,9 @@ impl From for CommandError { | RevsetResolutionError::WorkspaceMissingWorkingCopy { .. } | RevsetResolutionError::AmbiguousCommitIdPrefix(_) | RevsetResolutionError::AmbiguousChangeIdPrefix(_) - | RevsetResolutionError::StoreError(_) => None, + | RevsetResolutionError::AmbiguousSymbol(_) + | RevsetResolutionError::StoreError(_) + | RevsetResolutionError::Other(_) => None, }; let mut cmd_err = user_error(err); cmd_err.extend_hints(hint); diff --git a/lib/src/revset.rs b/lib/src/revset.rs index 9b2006e07b6..5be054b8409 100644 --- a/lib/src/revset.rs +++ b/lib/src/revset.rs @@ -60,8 +60,12 @@ pub enum RevsetResolutionError { AmbiguousCommitIdPrefix(String), #[error("Change ID prefix \"{0}\" is ambiguous")] AmbiguousChangeIdPrefix(String), + #[error("Symbol \"{0}\" is ambiguous")] + AmbiguousSymbol(String), #[error("Unexpected error from store")] StoreError(#[source] BackendError), + #[error(transparent)] + Other(#[from] Box), } /// Error occurred during revset evaluation. @@ -2278,7 +2282,9 @@ fn resolve_symbols( | RevsetResolutionError::EmptyString | RevsetResolutionError::AmbiguousCommitIdPrefix(_) | RevsetResolutionError::AmbiguousChangeIdPrefix(_) - | RevsetResolutionError::StoreError(_) => Err(err), + | RevsetResolutionError::AmbiguousSymbol(_) + | RevsetResolutionError::StoreError(_) + | RevsetResolutionError::Other(_) => Err(err), }) .map(Some) // Always rewrite subtree }