# HG changeset patch # User Simon Sapin # Date 2021-03-02 22:18:23 # Node ID df247f58ecee02205bd0b3e5b8d3c31cdb83df03 # Parent 78e6700ab009172adc3f92285ec019a41a230514 rhg: Fall back to Python for unsupported revset syntax rhg only supports a small subset of the syntax. On parse error, this gives Python a chance instead of aborting immediately. Differential Revision: https://phab.mercurial-scm.org/D10097 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 @@ -2,6 +2,7 @@ //! //! +use crate::errors::HgError; use crate::repo::Repo; use crate::revlog::changelog::Changelog; use crate::revlog::revlog::{Revlog, RevlogError}; @@ -28,7 +29,10 @@ pub fn resolve_single( // TODO: support for the rest of the language here. - Err(RevlogError::InvalidRevision) + Err( + HgError::unsupported(format!("cannot parse revset '{}'", input)) + .into(), + ) } /// Resolve the small subset of the language suitable for revlogs other than