Page MenuHomeSoftware Heritage

replay: ensure a revision is present only once in a batch
ClosedPublic

Authored by douardda on Nov 28 2019, 4:16 PM.

Diff Detail

Repository
rDJNL Journal infrastructure
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

anlambert added a subscriber: anlambert.
anlambert added inline comments.
swh/journal/replay.py
78

I would rather use

for rev in set(revisions):

to remove duplicates but I don't know if the original revision ordering matters here.

This revision is now accepted and ready to land.Nov 29 2019, 11:26 AM
This revision was landed with ongoing or failed builds.Nov 29 2019, 11:45 AM
This revision was automatically updated to reflect the committed changes.
olasd added inline comments.
swh/journal/replay.py
78

The order matters, and (ideally) we need to keep only the last version of the object.

I guess the easiest solution is to put the revisions in a dict keyed by id, and return the values() of that dict.