As part of moving dirstate storage to its own class, let's move the source of
truth for the dirstate parents to dirstatemap. This requires that dirstate._pl
no longer be a cache, and that all sets go through dirstatemap.setparents.
Details
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
The logic here isn't readable enough that IMO we should fix it in flight.
mercurial/dirstate.py | ||
---|---|---|
1401–1402 | This code doesn't read very cleanly. The only cases where self._parents won't be set here are if the file exists but is empty or the file doesn't exist. I'd rather make that logic explicit and assert self._parents here. Note that if the code were changed so an empty string represented both missing and empty files, the resulting code would be pretty clear via a switch statement against the content length. |
mercurial/dirstate.py | ||
---|---|---|
320 | Can/should parents(), p1(), and p2() here all be updated to go through map.parents()? We should be moving in the direction of removing _pl, no? |
Can/should parents(), p1(), and p2() here all be updated to go through map.parents()? We should be moving in the direction of removing _pl, no?