( )⚙ D6581 update: fix spurious unclean status bug shown by previous commit

This is an archive of the discontinued Mercurial Phabricator instance.

update: fix spurious unclean status bug shown by previous commit
ClosedPublic

Authored by valentin.gatienbaron on Jun 27 2019, 7:00 AM.

Details

Summary

The crux of the problem is:

  • the dirstate is corrupted (the sizes/dates are assigned to the wrong files)
  • because when worker.worker is used with a return value (batchget in merge.py here), the return value when worker.worker effectively parallelizes is permuted
  • this is because worker.worker's partition of input and combination of output values are not inverses of one another: it split [1,2,3,4,5,6] into [[1,3,5],[2,4,6]], but combines that into [1,3,5,2,4,6].

Given that worker.worker doesn't call its function argument on contiguous
chunks on the input arguments, sticking with lists means we'd need to
know the relation between the inputs of worker.worker function argument
(for instance, requiring that every input element is mapped to exactly
one output element). It seems better to instead switch return values to
dicts, which can combined reliably with a straighforward restriction.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz accepted this revision.Jun 27 2019, 11:05 AM
martinvonz added a subscriber: martinvonz.

Thanks for fixing this quickly! The fix looks very straight-forward too.

This revision is now accepted and ready to land.Jun 27 2019, 11:05 AM