Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/revision.py
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | |||||
) -> None: | ) -> None: | ||||
assert revision.date is not None | assert revision.date is not None | ||||
provenance.revision_add(revision) | provenance.revision_add(revision) | ||||
stack = [graph] | stack = [graph] | ||||
while stack: | while stack: | ||||
current = stack.pop() | current = stack.pop() | ||||
if current.dbdate is not None: | if current.dbdate is not None: | ||||
assert current.dbdate <= revision.date | assert current.dbdate < revision.date | ||||
if trackall: | if trackall: | ||||
# Current directory is an outer isochrone frontier for a previously | # Current directory is an outer isochrone frontier for a previously | ||||
# processed revision. It should be reused as is. | # processed revision. It should be reused as is. | ||||
provenance.directory_add_to_revision( | provenance.directory_add_to_revision( | ||||
revision, current.entry, current.path | revision, current.entry, current.path | ||||
) | ) | ||||
else: | else: | ||||
assert current.maxdate is not None | assert current.maxdate is not None | ||||
Show All 19 Lines | while stack: | ||||
directory_flatten( | directory_flatten( | ||||
provenance, archive, current.entry, minsize=minsize | provenance, archive, current.entry, minsize=minsize | ||||
) | ) | ||||
else: | else: | ||||
# If current node is an invalidated frontier, update its date for future | # If current node is an invalidated frontier, update its date for future | ||||
# revisions to get the proper value. | # revisions to get the proper value. | ||||
if current.invalid: | if current.invalid: | ||||
provenance.directory_set_date_in_isochrone_frontier( | provenance.directory_set_date_in_isochrone_frontier( | ||||
current.entry, current.maxdate | current.entry, revision.date | ||||
) | ) | ||||
# No point moving the frontier here. Either there are no files or they | # No point moving the frontier here. Either there are no files or they | ||||
# are being seen for the first time here. Add all blobs to current | # are being seen for the first time here. Add all blobs to current | ||||
# revision updating date if necessary, and recursively analyse | # revision updating date if necessary, and recursively analyse | ||||
# subdirectories as candidates to the outer frontier. | # subdirectories as candidates to the outer frontier. | ||||
for blob in current.entry.files: | for blob in current.entry.files: | ||||
date = provenance.content_get_early_date(blob) | date = provenance.content_get_early_date(blob) | ||||
if date is None or revision.date < date: | if date is None or revision.date < date: | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |