Patchwork D10097: rhg: Fall back to Python for unsupported revset syntax

login
register
mail settings
Submitter phabricator
Date March 3, 2021, 5:09 p.m.
Message ID <differential-rev-PHID-DREV-z4ehuwaew6oujjiuyrgb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48410/
State Superseded
Headers show

Comments

phabricator - March 3, 2021, 5:09 p.m.
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10097

AFFECTED FILES
  rust/hg-core/src/revset.rs

CHANGE DETAILS




To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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 @@ 
 //!
 //! <https://www.mercurial-scm.org/repo/hg/help/revsets>
 
+use crate::errors::HgError;
 use crate::repo::Repo;
 use crate::revlog::changelog::Changelog;
 use crate::revlog::revlog::{Revlog, RevlogError};
@@ -28,7 +29,10 @@ 
 
     // 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