Skip to content
Snippets Groups Projects

algos: Add directory_get_many_with_possibly_duplicated_entries

Merged vlorentz requested to merge directory_get_many_with_possibly_duplicated_entries into master
1 unresolved thread

It's like directory_get_many, but allows building directories via Directory.from_possibly_duplicated_entries().

It will be used by swh-scrubber in order not to crash on such directories: swh-scrubber#4693 (closed)

Edited by vlorentz

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
62 62 raw_manifest=raw_manifests[directory_id],
63 63 )
64
65
66 def directory_get_many_with_possibly_duplicated_entries(
67 storage: StorageInterface, directory_ids: List[Sha1Git]
68 ) -> Iterable[Optional[Tuple[bool, Directory]]]:
69 """Same as :func:`directory_get_many`, but does not error on directories whose
70 entries may contain duplicated names.
71 See :meth:`swh.model.model.Directory.from_possibly_duplicated_entries`.
72
73 Args:
74 storage: the storage instance
75 directory_ids: the directories' identifiers
76 Yields:
77 ``(is_corrupt, directory)`` where ``is_corrupt`` is True iff some
  • Looks good to me.

  • Antoine Lambert approved this merge request

    approved this merge request

  • merged

  • Please register or sign in to reply
    Loading