4from typing
import List, Optional, Tuple
9 is_console_interactive,
11 split_auth_from_netloc,
33 repo_name =
"checkout"
34 schemes = (
"svn+ssh",
"svn+http",
"svn+https",
"svn+svn",
"svn+file")
47 Return the maximum revision for all files under a given location
52 for base, dirs, _
in os.walk(location):
65 assert dirurl
is not None
70 revision = max(revision, localrev)
75 cls, netloc: str, scheme: str
76 ) -> Tuple[str, Tuple[Optional[str], Optional[str]]]:
78 This override allows the auth information to be passed to svn via the
79 --username and --password options instead of via the URL.
86 return split_auth_from_netloc(netloc)
94 return url, rev, user_pass
98 username: Optional[str], password: Optional[HiddenText]
100 extra_args: CommandArgs = []
102 extra_args += [
"--username", username]
104 extra_args += [
"--password", password]
112 orig_location = location
113 while not is_installable_dir(location):
114 last_location = location
116 if location == last_location:
120 "Could not find Python project for directory %s (tried all "
121 "parent directories)",
124 raise RemoteNotFoundError
128 raise RemoteNotFoundError
138 with open(entries_path)
as f:
148 revs = [int(d[9])
for d
in entries
if len(d) > 9
and d[9]] + [0]
152 raise ValueError(f
"Badly formatted data: {data!r}")
164 [
"info",
"--xml", location],
169 assert match
is not None
172 except InstallationError:
184 """Always assume the versions don't match"""
187 def __init__(self, use_interactive: Optional[bool] =
None) ->
None:
188 if use_interactive
is None:
189 use_interactive = is_console_interactive()
202 """Query the version of the currently installed Subversion client.
204 :return: A tuple containing the parts of the version information or
205 ``()`` if the version returned from ``svn`` could not be parsed.
206 :raises: BadCommand: If ``svn`` is not installed.
215 version_prefix =
"svn, version "
216 version = self.
run_command([
"--version"], show_stdout=
False, stdout_only=
True)
220 version = version[
len(version_prefix) :].split()[0]
223 parsed_version = tuple(map(int, version_list))
227 return parsed_version
230 """Return the version of the currently installed Subversion client.
232 If the version of the Subversion client has already been queried,
233 a cached value will be used.
235 :return: A tuple containing the parts of the version information or
236 ``()`` if the version returned from ``svn`` could not be parsed.
237 :raises: BadCommand: If ``svn`` is not installed.
250 """Return options to be used on calls to Subversion that contact the server.
252 These options are applicable for the following ``svn`` subcommands used
259 :return: A list of command line arguments to pass to ``svn``.
264 return [
"--non-interactive"]
275 if svn_version >= (1, 8):
276 return [
"--force-interactive"]
281 self, dest: str, url: HiddenText, rev_options: RevOptions, verbosity: int
285 "Checking out %s%s to %s",
294 cmd_args = make_command(
304 def switch(self, dest: str, url: HiddenText, rev_options: RevOptions) ->
None:
305 cmd_args = make_command(
314 def update(self, dest: str, url: HiddenText, rev_options: RevOptions) ->
None:
315 cmd_args = make_command(
List[str] get_base_rev_args(str rev)
Tuple[str, Tuple[Optional[str], Optional[str]]] get_netloc_and_auth(cls, str netloc, str scheme)
CommandArgs get_remote_call_options(self)
bool should_add_vcs_url_prefix(cls, str remote_url)
Tuple[int,...] call_vcs_version(self)
Tuple[str, Optional[str], AuthInfo] get_url_rev_and_auth(cls, str url)
CommandArgs make_rev_args(Optional[str] username, Optional[HiddenText] password)
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)
None __init__(self, Optional[bool] use_interactive=None)
Tuple[Optional[str], int] _get_svn_url_rev(cls, str location)
None switch(self, str dest, HiddenText url, RevOptions rev_options)
None update(self, str dest, HiddenText url, RevOptions rev_options)
Tuple[int,...] get_vcs_version(self)
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)