Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/ra.py
Show First 20 Lines • Show All 454 Lines • ▼ Show 20 Lines | ) -> Tuple[List[Content], List[SkippedContent], List[Directory]]: | ||||
""" | """ | ||||
self.replay(rev) | self.replay(rev) | ||||
# TODO: Move this listing up in swh.model | # TODO: Move this listing up in swh.model | ||||
contents: List[Content] = [] | contents: List[Content] = [] | ||||
skipped_contents: List[SkippedContent] = [] | skipped_contents: List[SkippedContent] = [] | ||||
directories: List[Directory] = [] | directories: List[Directory] = [] | ||||
for obj in self.directory.iter_tree(): | for obj in self.directory.iter_tree(): | ||||
obj = obj.to_model() | obj = obj.to_model() | ||||
if isinstance(obj, Content): | obj_type = obj.object_type | ||||
if obj_type in ("content_file", "content"): | |||||
obj = obj.with_data() | obj = obj.with_data() | ||||
contents.append(obj) | contents.append(obj) | ||||
elif isinstance(obj, SkippedContent): | elif obj_type == "skipped_content": | ||||
skipped_contents.append(obj) | skipped_contents.append(obj) | ||||
elif isinstance(obj, Directory): | elif obj_type == "directory": | ||||
directories.append(obj) | directories.append(obj) | ||||
else: | else: | ||||
raise TypeError(f"Unexpected content type from disk: {obj}") | raise TypeError(f"Unexpected content type from disk: {obj}") | ||||
return contents, skipped_contents, directories | return contents, skipped_contents, directories | ||||
@click.command() | @click.command() | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |