Page MenuHomePhabricator

cleanup: fix leakage of dirstate._map to client code
ClosedPublic

Authored by durin42 on Sep 10 2019, 10:01 AM.

Details

Summary

We already had proper accessors for most of the behavior of
dirstate._map that callers cared about exposed in the actual dirstate
class as public methods. Sigh.

There are two remaining privacy violations in the codebase after this change:

  1. In the perf extension, which I suspect has to stick around because it's really testing the dirstate implementation directly
  2. In largefiles, where we deal with standins and mutating status. Looking at this, I _strongly_ suspect a formal dirstate interface would allow this to work via composition instead of inheritance and monkeypatching. Fortunately, such wins are a part of my motivation for this work. I anticipate we'll come back to this in due time.

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

durin42 created this revision.Sep 10 2019, 10:01 AM
  1. In lfs, where we deal with standins and mutating status.

s/lfs/largefiles/?

durin42 edited the summary of this revision. (Show Details)Sep 11 2019, 9:53 AM
  1. In lfs, where we deal with standins and mutating status.

s/lfs/largefiles/?

Good catch, fixed.

indygreg accepted this revision.Sep 11 2019, 10:47 PM
This revision is now accepted and ready to land.Sep 11 2019, 10:47 PM
pulkit accepted this revision.Sep 12 2019, 1:55 AM
This revision was automatically updated to reflect the committed changes.