Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
Bazaar Class Reference
Inheritance diagram for Bazaar:
Collaboration diagram for Bazaar:

Public Member Functions

None fetch_new (self, str dest, HiddenText url, RevOptions rev_options, int verbosity)
 
None switch (self, str dest, HiddenText url, RevOptions rev_options)
 
None update (self, str dest, HiddenText url, RevOptions rev_options)
 
Tuple[str, Optional[str], AuthInfo] get_url_rev_and_auth (cls, str url)
 
str get_remote_url (cls, str location)
 
str get_revision (cls, str location)
 
bool is_commit_id_equal (cls, str dest, Optional[str] name)
 
- Public Member Functions inherited from VersionControl
bool should_add_vcs_url_prefix (cls, str remote_url)
 
Optional[str] get_subdirectory (cls, str location)
 
str get_requirement_revision (cls, str repo_dir)
 
str get_src_requirement (cls, str repo_dir, str project_name)
 
bool is_immutable_rev_checkout (self, str url, str dest)
 
RevOptions make_rev_options (cls, Optional[str] rev=None, Optional[CommandArgs] extra_args=None)
 
Tuple[str, Tuple[Optional[str], Optional[str]]] get_netloc_and_auth (cls, str netloc, str scheme)
 
Tuple[HiddenText, RevOptionsget_url_rev_options (self, HiddenText url)
 
bool compare_urls (cls, str url1, str url2)
 
None obtain (self, str dest, HiddenText url, int verbosity)
 
None unpack (self, str location, HiddenText url, int verbosity)
 
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)
 
bool is_repository_directory (cls, str path)
 
Optional[str] get_repository_root (cls, str location)
 

Static Public Member Functions

List[str] get_base_rev_args (str rev)
 
- Static Public Member Functions inherited from VersionControl
CommandArgs make_rev_args (Optional[str] username, Optional[HiddenText] password)
 
str normalize_url (str url)
 

Static Public Attributes

str name = "bzr"
 
str dirname = ".bzr"
 
str repo_name = "branch"
 
tuple schemes
 
- Static Public Attributes inherited from VersionControl
str name = ""
 
str dirname = ""
 
str repo_name = ""
 
tuple schemes = ()
 
tuple unset_environ = ()
 
Optional default_arg_rev = None
 

Additional Inherited Members

- Data Fields inherited from VersionControl
 repo_name
 
 name
 
 dirname
 
- Protected Member Functions inherited from VersionControl
bool _is_local_repository (cls, str repo)
 

Detailed Description

Definition at line 18 of file bazaar.py.

Member Function Documentation

◆ fetch_new()

None fetch_new (   self,
str  dest,
HiddenText  url,
RevOptions  rev_options,
int   verbosity 
)
Fetch a revision from a repository, in the case that this is the
first fetch from the repository.

Args:
  dest: the directory to fetch the repository to.
  rev_options: a RevOptions object.
  verbosity: verbosity level.

Reimplemented from VersionControl.

Definition at line 36 of file bazaar.py.

38 ) -> None:
39 rev_display = rev_options.to_display()
41 "Checking out %s%s to %s",
42 url,
43 rev_display,
44 display_path(dest),
45 )
46 if verbosity <= 0:
47 flag = "--quiet"
48 elif verbosity == 1:
49 flag = ""
50 else:
51 flag = f"-{'v'*verbosity}"
52 cmd_args = make_command(
53 "checkout", "--lightweight", flag, rev_options.to_args(), url, dest
54 )
55 self.run_command(cmd_args)
56
for i

References i, VersionControl.run_command(), SubprocessMixin.run_command(), and PackageIndex.run_command().

Referenced by VersionControl.obtain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_base_rev_args()

List[str] get_base_rev_args ( str  rev)
static
Return the base revision arguments for a vcs command.

Args:
  rev: the name of a revision to install.  Cannot be None.

Reimplemented from VersionControl.

Definition at line 33 of file bazaar.py.

33 def get_base_rev_args(rev: str) -> List[str]:
34 return ["-r", rev]
35

◆ get_remote_url()

str get_remote_url (   cls,
str  location 
)
Return the url used at location

Raises RemoteNotFoundError if the repository does not have a remote
url configured.

Reimplemented from VersionControl.

Definition at line 82 of file bazaar.py.

82 def get_remote_url(cls, location: str) -> str:
83 urls = cls.run_command(
84 ["info"], show_stdout=False, stdout_only=True, cwd=location
85 )
86 for line in urls.splitlines():
87 line = line.strip()
88 for x in ("checkout of branch: ", "parent branch: "):
89 if line.startswith(x):
90 repo = line.split(x)[1]
91 if cls._is_local_repository(repo):
92 return path_to_url(repo)
93 return repo
94 raise RemoteNotFoundError
95

References VersionControl._is_local_repository(), i, VersionControl.run_command(), SubprocessMixin.run_command(), and PackageIndex.run_command().

Referenced by VersionControl.get_src_requirement(), and VersionControl.obtain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_revision()

str get_revision (   cls,
str  location 
)
Return the current commit id of the files at the given location.

Reimplemented from VersionControl.

Definition at line 97 of file bazaar.py.

97 def get_revision(cls, location: str) -> str:
98 revision = cls.run_command(
99 ["revno"],
100 show_stdout=False,
101 stdout_only=True,
102 cwd=location,
103 )
104 return revision.splitlines()[-1]
105

References i, VersionControl.run_command(), SubprocessMixin.run_command(), and PackageIndex.run_command().

Referenced by VersionControl.get_requirement_revision().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_url_rev_and_auth()

Tuple[str, Optional[str], AuthInfo] get_url_rev_and_auth (   cls,
str  url 
)
Parse the repository URL to use, and return the URL, revision,
and auth info to use.

Returns: (url, rev, (username, password)).

Reimplemented from VersionControl.

Definition at line 74 of file bazaar.py.

74 def get_url_rev_and_auth(cls, url: str) -> Tuple[str, Optional[str], AuthInfo]:
75 # hotfix the URL scheme after removing bzr+ from bzr+ssh:// re-add it
76 url, rev, user_pass = super().get_url_rev_and_auth(url)
77 if url.startswith("ssh://"):
78 url = "bzr+" + url
79 return url, rev, user_pass
80

References Bazaar.get_url_rev_and_auth(), and i.

Referenced by Bazaar.get_url_rev_and_auth(), and VersionControl.get_url_rev_options().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_commit_id_equal()

bool is_commit_id_equal (   cls,
str  dest,
Optional[str]  name 
)
Always assume the versions don't match

Reimplemented from VersionControl.

Definition at line 107 of file bazaar.py.

107 def is_commit_id_equal(cls, dest: str, name: Optional[str]) -> bool:
108 """Always assume the versions don't match"""
109 return False
110
111

References i.

Referenced by VersionControl.obtain().

Here is the caller graph for this function:

◆ switch()

None switch (   self,
str  dest,
HiddenText  url,
RevOptions  rev_options 
)
Switch the repo at ``dest`` to point to ``URL``.

Args:
  rev_options: a RevOptions object.

Reimplemented from VersionControl.

Definition at line 57 of file bazaar.py.

57 def switch(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None:
58 self.run_command(make_command("switch", url), cwd=dest)
59

References VersionControl.run_command(), SubprocessMixin.run_command(), and PackageIndex.run_command().

Here is the call graph for this function:

◆ update()

None update (   self,
str  dest,
HiddenText  url,
RevOptions  rev_options 
)
Update an already-existing repo to the given ``rev_options``.

Args:
  rev_options: a RevOptions object.

Reimplemented from VersionControl.

Definition at line 60 of file bazaar.py.

60 def update(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None:
61 output = self.run_command(
62 make_command("info"), show_stdout=False, stdout_only=True, cwd=dest
63 )
64 if output.startswith("Standalone "):
65 # Older versions of pip used to create standalone branches.
66 # Convert the standalone branch to a checkout by calling "bzr bind".
67 cmd_args = make_command("bind", "-q", url)
68 self.run_command(cmd_args, cwd=dest)
69
70 cmd_args = make_command("update", "-q", rev_options.to_args())
71 self.run_command(cmd_args, cwd=dest)
72

References i, VersionControl.run_command(), SubprocessMixin.run_command(), and PackageIndex.run_command().

Referenced by Progress.increment(), Progress.open(), Progress.start(), Progress.stop(), Progress.track(), and Progress.wrap_file().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ dirname

◆ name

str name = "bzr"
static

Definition at line 19 of file bazaar.py.

Referenced by AlreadyInstalledCandidate.__eq__(), Distribution.__eq__(), ExportEntry.__eq__(), _LazyDescr.__get__(), Distribution.__hash__(), ElementState.__init__(), Requirement.__init__(), LinkHash.__post_init__(), InstallationCandidate.__repr__(), Distribution.__repr__(), Metadata.__repr__(), ExportEntry.__repr__(), Encoding.__repr__(), Color.__rich_repr__(), Layout.__rich_repr__(), InstallationCandidate.__str__(), InstalledDistribution.__str__(), EggInfoDistribution.__str__(), Requirement.__str__(), ParserElement.__str__(), Tag.__str__(), _SixMetaPathImporter._add_module(), Matcher._check_compatible(), InstallRequirement._get_archive_name(), Wheel._get_extensions(), _SixMetaPathImporter._get_module(), ConfigOptionParser._get_ordered_configuration_items(), Distribution._get_requirements(), _Cache.add(), InstallRequirement.archive(), LinkHash.as_dict(), LinkHash.as_hashes(), Wheel.build(), _Cache.clear(), Wheel.filename(), Layout.get(), InstallRequirement.get_dist(), InstalledDistribution.get_distinfo_file(), RequirementCommand.get_requirements(), Wheel.get_wheel_metadata(), InstallRequirement.install(), Wheel.install(), SpecifierRequirement.is_satisfied_by(), LinuxDistribution.linux_distribution(), Wheel.metadata(), Distribution.name_and_version(), InstallRequirement.prepare_metadata(), Distribution.provides(), Metadata.provides(), VcsSupport.register(), VersionControl.run_command(), InstallRequirement.uninstall(), Wheel.update(), and Wheel.verify().

◆ repo_name

str repo_name = "branch"
static

Definition at line 21 of file bazaar.py.

Referenced by VersionControl.obtain().

◆ schemes

tuple schemes
static
Initial value:
= (
"bzr+http",
"bzr+https",
"bzr+ssh",
"bzr+sftp",
"bzr+ftp",
"bzr+lp",
"bzr+file",
)

Definition at line 22 of file bazaar.py.


The documentation for this class was generated from the following file: