This is an archive of the discontinued Mercurial Phabricator instance.

dirstate-entry: turn dirstate tuple into a real object (like in C)
ClosedPublic

Authored by marmoute on Jul 4 2021, 5:49 PM.

Details

Summary

With dirstate V2, the stored information and actual format will change. This mean we need to start an a better abstraction for a dirstate entry that a tuple directly accessed.

By chance, the C code is already doing this and pretend to be a tuple. So it
should be fairly easy. We start with turning the tuple into an object, we will
slowly migrate the dirstate code to no longer use the tuple directly in later
changesets.

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.Jul 4 2021, 5:49 PM
SimonSapin accepted this revision.Jul 4 2021, 11:54 PM
pulkit added a subscriber: pulkit.Jul 6 2021, 12:20 PM

s/that a tuple directly accessed/than a tuple directly accessed in commit message.

mercurial/pure/parsers.py
37

s/represente/represent

39

s/constains/contains

baymax updated this revision to Diff 28851.Jul 6 2021, 2:08 PM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

pulkit accepted this revision.Jul 6 2021, 2:49 PM
This revision is now accepted and ready to land.Jul 6 2021, 2:49 PM
durin42 added a subscriber: durin42.Jul 8 2021, 4:38 PM

Could this be an attr.s instead of a bespoke class with slots?

mercurial/pure/parsers.py
47

Typo: this should be __slots__ (note missing s in submitted code). Please send a followup for that (or preferably replacing this bespoke object with an attr.s)

FYI: I did the followup as D11030 because I found myself with a few minutes.