This is an archive of the discontinued Mercurial Phabricator instance.

rhg: Set second_ambiguous as needed in post-status fixup
ClosedPublic

Authored by SimonSapin on Dec 9 2021, 4:55 AM.

Details

Summary

This fixes an intermittent bug that manifested only in test-revert.t,
and unfortunately not on CI. On a fast enough machine we could have:

  1. A file is modified
  2. rhg status writes an updated dirstate-v1
  3. The same file is modified again

… all within the same integer second. Because the dirstate-v1 file format
does not store sub-second precision, step 2 must write the file’s mtime
as "unknown" because of the possibility of step 3.

However, most of the code now handles timestamps with nanosecond precision
in order to take advantage of it in dirstate-v2. second_ambiguous must
be set for timestamps that become ambiguous if sub-second precision is dropped
(such as through serialization in dirstate-v1 format).

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

SimonSapin created this revision.Dec 9 2021, 4:55 AM
Alphare accepted this revision.Dec 10 2021, 5:38 AM
This revision is now accepted and ready to land.Dec 10 2021, 5:38 AM
Alphare added a comment.EditedDec 10 2021, 8:26 AM

Does not pass CI, I've removed it from the queue, please re-send. (oops, that was meant for D11890)