This is an archive of the discontinued Mercurial Phabricator instance.

dirstate: move parent reading to the dirstatemap class
ClosedPublic

Authored by durham on Sep 20 2017, 8:03 PM.

Details

Summary

As part of moving dirstate storage logic to a separate class, let's move the
function that reads the parents from the file. This will allow extensions to
write dirstate's that store the parents in other ways.

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

durham created this revision.Sep 20 2017, 8:03 PM
indygreg accepted this revision.Sep 24 2017, 11:25 AM
indygreg added a subscriber: indygreg.

Lots of comments. But nothing that should warrant blocking.

mercurial/dirstate.py
1376

Nit: this should ideally be in a context manager or try..finally block. But it existed this way before, so not worth blocking over.

1381

Another pre-existing poor error message because it isn't actionable :/

1382–1384

Idea for follow-up: a vfs layer that operates on pending files. Maybe we could pass pending=True somewhere? That way we can use vfs.tryread() instead of this low-level code. Not sure if we have enough consumers to warrant that though.

This revision is now accepted and ready to land.Sep 24 2017, 11:25 AM
durham updated this revision to Diff 2082.Sep 26 2017, 6:59 AM
durham added inline comments.Sep 26 2017, 7:00 AM
mercurial/dirstate.py
1376

Left this alone for now to avoid code churn during the refactor.

This revision was automatically updated to reflect the committed changes.