( )⚙ D12122 dirstate: use a context manager when writing the dirstate

This is an archive of the discontinued Mercurial Phabricator instance.

dirstate: use a context manager when writing the dirstate
ClosedPublic

Authored by marmoute on Jan 31 2022, 10:30 AM.

Details

Summary

This make sure the file is closed in a timely manner.

We define a lambda for the file opening. It might seems a bit overkill here but
a future changeset will need to do more of those.

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

marmoute created this revision.Jan 31 2022, 10:30 AM
Alphare accepted this revision.Feb 3 2022, 4:56 AM
This revision is now accepted and ready to land.Feb 3 2022, 4:56 AM