Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/graph.py
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | while stack: | ||||
if child.maxdate is None: | if child.maxdate is None: | ||||
# if child.maxdate is None, it must be processed | # if child.maxdate is None, it must be processed | ||||
stack.append(child) | stack.append(child) | ||||
else: | else: | ||||
# all the files and directories under current have a maxdate, | # all the files and directories under current have a maxdate, | ||||
# we can infer the maxdate for current directory | # we can infer the maxdate for current directory | ||||
assert current.maxdate is None | assert current.maxdate is None | ||||
# if all content is already known, update current directory info. | # if all content is already known, update current directory info. | ||||
current.maxdate = min( | current.maxdate = max( | ||||
max( | |||||
[UTCMIN] | [UTCMIN] | ||||
+ [ | + [ | ||||
child.maxdate | child.maxdate | ||||
for child in current.children | for child in current.children | ||||
if child.maxdate is not None # for mypy | if child.maxdate is not None # for mypy | ||||
] | ] | ||||
+ [ | + [ | ||||
fdates.get(file.id, revision.date) | fdates.get(file.id, revision.date) | ||||
for file in current.entry.files | for file in current.entry.files | ||||
] | ] | ||||
), | |||||
revision.date, | |||||
) | ) | ||||
return root | return root |