Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/loader.py
Show First 20 Lines • Show All 427 Lines • ▼ Show 20 Lines | def prepare(self): | ||||
local_dirname = self._create_tmp_dir(self.temp_directory) | local_dirname = self._create_tmp_dir(self.temp_directory) | ||||
self.svnrepo = self.svn_repo( | self.svnrepo = self.svn_repo( | ||||
self.svn_url, | self.svn_url, | ||||
self.origin.url, | self.origin.url, | ||||
local_dirname, | local_dirname, | ||||
self.max_content_size, | self.max_content_size, | ||||
self.from_dump, | self.from_dump, | ||||
debug=self.debug, | |||||
) | ) | ||||
try: | try: | ||||
revision_start, revision_end = self.start_from() | revision_start, revision_end = self.start_from() | ||||
self.swh_revision_gen = self.process_svn_revisions( | self.swh_revision_gen = self.process_svn_revisions( | ||||
self.svnrepo, revision_start, revision_end | self.svnrepo, revision_start, revision_end | ||||
) | ) | ||||
except SvnLoaderUneventful as e: | except SvnLoaderUneventful as e: | ||||
▲ Show 20 Lines • Show All 350 Lines • ▼ Show 20 Lines | ) -> Tuple[str, int]: | ||||
) | ) | ||||
def prepare(self): | def prepare(self): | ||||
# First, check if previous revisions have been loaded for the | # First, check if previous revisions have been loaded for the | ||||
# subversion origin and get the number of the last one | # subversion origin and get the number of the last one | ||||
last_loaded_svn_rev = self.get_last_loaded_svn_rev(self.origin.url) | last_loaded_svn_rev = self.get_last_loaded_svn_rev(self.origin.url) | ||||
self.svnrepo = self.svn_repo( | self.svnrepo = self.svn_repo( | ||||
self.origin.url, self.origin.url, self.temp_dir, self.max_content_size | self.origin.url, | ||||
self.origin.url, | |||||
self.temp_dir, | |||||
self.max_content_size, | |||||
debug=self.debug, | |||||
) | ) | ||||
# Ensure to use remote URL retrieved by SvnRepo as origin URL might redirect | # Ensure to use remote URL retrieved by SvnRepo as origin URL might redirect | ||||
# and svnrdump does not handle URL redirection | # and svnrdump does not handle URL redirection | ||||
self.svn_url = self.svnrepo.remote_url | self.svn_url = self.svnrepo.remote_url | ||||
# Then for stale repository, check if the last loaded revision in the archive | # Then for stale repository, check if the last loaded revision in the archive | ||||
# is different from the last revision on the remote subversion server. | # is different from the last revision on the remote subversion server. | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |