diff --git a/rust/hg-core/src/revset.rs b/rust/hg-core/src/revset.rs --- a/rust/hg-core/src/revset.rs +++ b/rust/hg-core/src/revset.rs @@ -18,21 +18,19 @@ ) -> Result { let changelog = repo.changelog()?; - match resolve_rev_number_or_hex_prefix(input, &changelog.revlog) { - Err(RevlogError::InvalidRevision) => {} // Try other syntax - result => return result, + match input { + "null" => return Ok(NULL_REVISION), + _ => {} } - if input == "null" { - return Ok(NULL_REVISION); + match resolve_rev_number_or_hex_prefix(input, &changelog.revlog) { + Err(RevlogError::InvalidRevision) => { + // TODO: support for the rest of the language here. + let msg = format!("cannot parse revset '{}'", input); + Err(HgError::unsupported(msg).into()) + } + result => return result, } - - // TODO: support for the rest of the language here. - - Err( - HgError::unsupported(format!("cannot parse revset '{}'", input)) - .into(), - ) } /// Resolve the small subset of the language suitable for revlogs other than