Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/loader.py
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | ADDITIONAL_CONFIG = { | ||||
'temp_directory': ('str', '/tmp'), | 'temp_directory': ('str', '/tmp'), | ||||
'debug': ('bool', False), # NOT FOR PRODUCTION, False for production | 'debug': ('bool', False), # NOT FOR PRODUCTION, False for production | ||||
'check_revision': ('dict', { | 'check_revision': ('dict', { | ||||
'status': False, # do we check the revision? | 'status': False, # do we check the revision? | ||||
'limit': 1000, # at which pace do we check it? | 'limit': 1000, # at which pace do we check it? | ||||
}), | }), | ||||
} | } | ||||
visit_type = 'svn' | |||||
def __init__(self): | def __init__(self): | ||||
super().__init__(logging_class='swh.loader.svn.SvnLoader') | super().__init__(logging_class='swh.loader.svn.SvnLoader') | ||||
self.origin_url = None | self.origin_url = None | ||||
self.debug = self.config['debug'] | self.debug = self.config['debug'] | ||||
self.last_seen_revision = None | self.last_seen_revision = None | ||||
self.temp_directory = self.config['temp_directory'] | self.temp_directory = self.config['temp_directory'] | ||||
self.done = False | self.done = False | ||||
self.svnrepo = None | self.svnrepo = None | ||||
▲ Show 20 Lines • Show All 354 Lines • ▼ Show 20 Lines | def process_svn_revisions(self, svnrepo, revision_start, revision_end, | ||||
revision_parents[nextrev] = [swh_revision['id']] | revision_parents[nextrev] = [swh_revision['id']] | ||||
yield _contents, _directories, swh_revision | yield _contents, _directories, swh_revision | ||||
def prepare_origin_visit(self, *, svn_url, visit_date=None, | def prepare_origin_visit(self, *, svn_url, visit_date=None, | ||||
origin_url=None, **kwargs): | origin_url=None, **kwargs): | ||||
self.origin = { | self.origin = { | ||||
'url': origin_url if origin_url else svn_url, | 'url': origin_url if origin_url else svn_url, | ||||
'type': 'svn', | 'type': self.visit_type, | ||||
} | } | ||||
self.visit_date = visit_date | self.visit_date = visit_date | ||||
def prepare(self, *, svn_url, destination_path=None, | def prepare(self, *, svn_url, destination_path=None, | ||||
swh_revision=None, start_from_scratch=False, **kwargs): | swh_revision=None, start_from_scratch=False, **kwargs): | ||||
self.start_from_scratch = start_from_scratch | self.start_from_scratch = start_from_scratch | ||||
if swh_revision: | if swh_revision: | ||||
self.last_known_swh_revision = swh_revision | self.last_known_swh_revision = swh_revision | ||||
▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines |