Patchwork D10101: rhg: Fall back to Python on --repository with an URL

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

Comments

phabricator - March 3, 2021, 6:25 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/D10101

AFFECTED FILES
  rust/rhg/src/main.rs

CHANGE DETAILS




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

Patch

diff --git a/rust/rhg/src/main.rs b/rust/rhg/src/main.rs
--- a/rust/rhg/src/main.rs
+++ b/rust/rhg/src/main.rs
@@ -95,6 +95,20 @@ 
             exit(&ui, on_unsupported, Err(error.into()))
         });
 
+    if let Some(repo_path_bytes) = &early_args.repo {
+        if repo_path_bytes.contains(&b':') {
+            exit(
+                &ui,
+                OnUnsupported::from_config(&non_repo_config),
+                Err(CommandError::UnsupportedFeature {
+                    message: format_bytes!(
+                        b"URL-like --repository {}",
+                        repo_path_bytes
+                    ),
+                }),
+            )
+        }
+    }
     let repo_path = early_args.repo.as_deref().map(get_path_from_bytes);
     let repo_result = match Repo::find(&non_repo_config, repo_path) {
         Ok(repo) => Ok(repo),