Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/svn.py
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | ): | ||||
# use redirection URL if any for remote operations | # use redirection URL if any for remote operations | ||||
self.remote_url = self.info(self.remote_url).url | self.remote_url = self.info(self.remote_url).url | ||||
# one connection for log iteration | # one connection for log iteration | ||||
self.conn_log = self.remote_access(auth) | self.conn_log = self.remote_access(auth) | ||||
# another for replay | # another for replay | ||||
self.conn = self.remote_access(auth) | self.conn = self.remote_access(auth) | ||||
if not self.from_dump: | |||||
self.remote_url = self.info(self.remote_url).repos_root_url | |||||
self.local_dirname = local_dirname | self.local_dirname = local_dirname | ||||
local_name = os.path.basename(self.remote_url) | local_name = os.path.basename(self.remote_url) | ||||
self.local_url = os.path.join(self.local_dirname, local_name).encode("utf-8") | self.local_url = os.path.join(self.local_dirname, local_name).encode("utf-8") | ||||
self.uuid = self.conn.get_uuid().encode("utf-8") | self.uuid = self.conn.get_uuid().encode("utf-8") | ||||
self.swhreplay = replay.Replay( | self.swhreplay = replay.Replay( | ||||
conn=self.conn, | conn=self.conn, | ||||
rootpath=self.local_url, | rootpath=self.local_url, | ||||
▲ Show 20 Lines • Show All 366 Lines • ▼ Show 20 Lines | def export_temporary(self, revision: int) -> Tuple[str, bytes]: | ||||
"Error parsing svn:externals property", | "Error parsing svn:externals property", | ||||
"Unrecognized format for the relative external URL", | "Unrecognized format for the relative external URL", | ||||
) | ) | ||||
): | ): | ||||
pass | pass | ||||
else: | else: | ||||
raise | raise | ||||
if self.from_dump: | # exported paths are relative to the repository root path so we need to | ||||
# when exporting a subpath of a subversion repository mounted from | # adjust the URL of the exported filesystem | ||||
# a dump file generated by svnrdump, exported paths are relative to | |||||
# the repository root path while they are relative to the subpath | |||||
# otherwise, so we need to adjust the URL of the exported filesystem | |||||
root_dir_local_url = os.path.join(local_url, self.root_directory.strip("/")) | root_dir_local_url = os.path.join(local_url, self.root_directory.strip("/")) | ||||
# check that root directory of a subproject did not get removed in revision | # check that root directory of a subproject did not get removed in revision | ||||
if os.path.exists(root_dir_local_url): | if os.path.exists(root_dir_local_url): | ||||
local_url = root_dir_local_url | local_url = root_dir_local_url | ||||
return local_dirname, os.fsencode(local_url) | return local_dirname, os.fsencode(local_url) | ||||
def swh_hash_data_per_revision( | def swh_hash_data_per_revision( | ||||
self, start_revision: int, end_revision: int | self, start_revision: int, end_revision: int | ||||
) -> Iterator[ | ) -> Iterator[ | ||||
Tuple[ | Tuple[ | ||||
int, | int, | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |