Page MenuHomePhabricator

tests: update narrowspec when narrowspec, not dirstate, is accessed
ClosedPublic

Authored by martinvonz on Nov 14 2018, 3:21 PM.

Details

Summary

test-narrow-expanddirstate.t mimics a Google-internal extension that
updates the narrowspec whenever the dirstate is accessed. Since
1d09ba0d2ed3 (narrow: move remaining narrow-limited dirstate walks to
core, 2018-10-01) and a few commits before it, we now longer restrict
repo.dirstate.walk() to the narrowspec. It is instead done at a higher
level (e.g. context.status()). We were running into problems with the
Google-internal extension when importing those commits. The issue was
that the narrowspec was read before the first dirstate access. I
believe the right fix is to instead update the narrowspec when trying
to read it (not when reading the dirstate), so that's what this patch
does.

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

martinvonz created this revision.Nov 14 2018, 3:21 PM
durin42 added inline comments.Dec 10 2018, 4:28 PM
tests/test-narrow-expanddirstate.t
59

dead assignment?

martinvonz planned changes to this revision.Dec 10 2018, 4:59 PM

I had forgotten that I had even sent this for review. I have some changes in my repo that I will share in a while (after I've address Yuya's comments on D5278).

martinvonz retitled this revision from tests: update store narrowspec when narrowspec, not dirstate, is accessed to tests: update narrowspec when narrowspec, not dirstate, is accessed.Dec 20 2018, 1:11 PM
This revision was automatically updated to reflect the committed changes.