4from typing
import List, Optional, Tuple
13 find_path_to_project_root_from_repo_root,
37 self, dest: str, url: HiddenText, rev_options: RevOptions, verbosity: int
41 "Cloning hg %s%s to %s",
47 flags: Tuple[str, ...] = (
"--quiet",)
51 flags = (
"--verbose",)
53 flags = (
"--verbose",
"--debug")
54 self.
run_command(make_command(
"clone",
"--noupdate", *flags, url, dest))
60 def switch(self, dest: str, url: HiddenText, rev_options: RevOptions) ->
None:
66 with open(repo_config,
"w")
as config_file:
69 logger.warning(
"Could not switch Mercurial repository to %s: %s", url, exc)
74 def update(self, dest: str, url: HiddenText, rev_options: RevOptions) ->
None:
82 [
"showconfig",
"paths.default"],
88 url = path_to_url(url)
94 Return the repository-local changeset revision number, as an integer.
97 [
"parents",
"--template={rev}"],
102 return current_revision
107 Return the changeset identification hash, as a 40-character
111 [
"parents",
"--template={node}"],
116 return current_rev_hash
120 """Always assume the versions don't match"""
126 Return the path to Python project root, relative to the repo root.
127 Return None if the project root is in the repo root.
131 [
"root"], show_stdout=
False, stdout_only=
True, cwd=location
135 return find_path_to_project_root_from_repo_root(location, repo_root)
148 on_returncode=
"raise",
149 log_failed_cmd=
False,
153 "could not determine if %s is under hg control "
154 "because hg is not available",
158 except InstallationError:
List[str] get_base_rev_args(str rev)
Optional[str] get_subdirectory(cls, str location)
str get_requirement_revision(cls, str location)
str get_remote_url(cls, str location)
str get_revision(cls, str location)
None fetch_new(self, str dest, HiddenText url, RevOptions rev_options, int verbosity)
bool is_commit_id_equal(cls, str dest, Optional[str] name)
Optional[str] get_repository_root(cls, str location)
None switch(self, str dest, HiddenText url, RevOptions rev_options)
None update(self, str dest, HiddenText url, RevOptions rev_options)
bool _is_local_repository(cls, str repo)
str run_command(cls, Union[List[str], CommandArgs] cmd, bool show_stdout=True, Optional[str] cwd=None, 'Literal["raise", "warn", "ignore"]' on_returncode="raise", Optional[Iterable[int]] extra_ok_returncodes=None, Optional[str] command_desc=None, Optional[Mapping[str, Any]] extra_environ=None, Optional[SpinnerInterface] spinner=None, bool log_failed_cmd=True, bool stdout_only=False)