Mercurial > hg
comparison hgext/largefiles/reposetup.py @ 42926:34ed651ba7e4
cleanup: fix leakage of dirstate._map to client code
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.
Differential Revision: https://phab.mercurial-scm.org/D6837
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 10 Sep 2019 09:41:58 -0400 |
parents | aaad36b88298 |
children | 2372284d9457 |
comparison
equal
deleted
inserted
replaced
42925:9fd7710d9ae2 | 42926:34ed651ba7e4 |
---|---|
232 removed = [f for f in removed | 232 removed = [f for f in removed |
233 if f not in self.dirstate] | 233 if f not in self.dirstate] |
234 result[2] = [f for f in result[2] | 234 result[2] = [f for f in result[2] |
235 if f not in lfdirstate] | 235 if f not in lfdirstate] |
236 | 236 |
237 lfiles = set(lfdirstate._map) | 237 lfiles = set(lfdirstate) |
238 # Unknown files | 238 # Unknown files |
239 result[4] = set(result[4]).difference(lfiles) | 239 result[4] = set(result[4]).difference(lfiles) |
240 # Ignored files | 240 # Ignored files |
241 result[5] = set(result[5]).difference(lfiles) | 241 result[5] = set(result[5]).difference(lfiles) |
242 # combine normal files and largefiles | 242 # combine normal files and largefiles |