Show More
@@ -826,8 +826,10 b' dependencies = [' | |||||
826 | "env_logger", |
|
826 | "env_logger", | |
827 | "format-bytes", |
|
827 | "format-bytes", | |
828 | "hg-core", |
|
828 | "hg-core", | |
|
829 | "lazy_static", | |||
829 | "log", |
|
830 | "log", | |
830 | "micro-timer", |
|
831 | "micro-timer", | |
|
832 | "regex", | |||
831 | "users", |
|
833 | "users", | |
832 | ] |
|
834 | ] | |
833 |
|
835 |
@@ -12,8 +12,10 b' hg-core = { path = "../hg-core"}' | |||||
12 | chrono = "0.4.19" |
|
12 | chrono = "0.4.19" | |
13 | clap = "2.33.1" |
|
13 | clap = "2.33.1" | |
14 | derive_more = "0.99" |
|
14 | derive_more = "0.99" | |
|
15 | lazy_static = "1.4.0" | |||
15 | log = "0.4.11" |
|
16 | log = "0.4.11" | |
16 | micro-timer = "0.3.1" |
|
17 | micro-timer = "0.3.1" | |
|
18 | regex = "1.3.9" | |||
17 | env_logger = "0.7.1" |
|
19 | env_logger = "0.7.1" | |
18 | format-bytes = "0.2.0" |
|
20 | format-bytes = "0.2.0" | |
19 | users = "0.11.0" |
|
21 | users = "0.11.0" |
@@ -95,6 +95,25 b' fn main() {' | |||||
95 | exit(&ui, on_unsupported, Err(error.into())) |
|
95 | exit(&ui, on_unsupported, Err(error.into())) | |
96 | }); |
|
96 | }); | |
97 |
|
97 | |||
|
98 | if let Some(repo_path_bytes) = &early_args.repo { | |||
|
99 | lazy_static::lazy_static! { | |||
|
100 | static ref SCHEME_RE: regex::bytes::Regex = | |||
|
101 | // Same as `_matchscheme` in `mercurial/util.py` | |||
|
102 | regex::bytes::Regex::new("^[a-zA-Z0-9+.\\-]+:").unwrap(); | |||
|
103 | } | |||
|
104 | if SCHEME_RE.is_match(&repo_path_bytes) { | |||
|
105 | exit( | |||
|
106 | &ui, | |||
|
107 | OnUnsupported::from_config(&non_repo_config), | |||
|
108 | Err(CommandError::UnsupportedFeature { | |||
|
109 | message: format_bytes!( | |||
|
110 | b"URL-like --repository {}", | |||
|
111 | repo_path_bytes | |||
|
112 | ), | |||
|
113 | }), | |||
|
114 | ) | |||
|
115 | } | |||
|
116 | } | |||
98 | let repo_path = early_args.repo.as_deref().map(get_path_from_bytes); |
|
117 | let repo_path = early_args.repo.as_deref().map(get_path_from_bytes); | |
99 | let repo_result = match Repo::find(&non_repo_config, repo_path) { |
|
118 | let repo_result = match Repo::find(&non_repo_config, repo_path) { | |
100 | Ok(repo) => Ok(repo), |
|
119 | Ok(repo) => Ok(repo), |
General Comments 0
You need to be logged in to leave comments.
Login now