This is an archive of the discontinued Mercurial Phabricator instance.

repair: invalidate volatile sets after stripping
ClosedPublic

Authored by martinvonz on Jan 21 2018, 1:41 PM.

Details

Summary

Matt Harbison reported that some tests were broken on Windows after
1a09dad8b85a (evolution: report new unstable changesets,
2018-01-14). The failures were exactly as seen in this patch. The
failures actually seemed correct, which made me wonder why they didn't
fail the same way on Linux. It turned out to be a cache invalidation
problem.

The new orphan mentioned in the test case actually does get created
when we're re-applying the temporary bundle that's created while
stripping. However, without the invalidation, it appears that there
was already an orphan before applying the temporary bundle.

The warnings about unknown working parent appear because the
aformentioned changeset means that we're now accessing the dirstate
while it's invalid.

We may want to suppress these messages that happen in the intermediate
strip state, but they're technically correct (although confusing to
the user), so I think just fixing the cache invalidation is fine for
now.

I haven't figured out why the caches seemed to get correctly
invalidated on Windows.

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.Jan 21 2018, 1:41 PM
quark added a subscriber: quark.Jan 21 2018, 5:06 PM

I haven't figured out why the caches seemed to get correctly invalidated on Windows.

I guess it's because filecache is a no-op on Windows. So things like repo._filecache[x].refresh() is doing nothing.

That worked for me, thanks.

FWIW, a couple of years ago, there were test failures in evolve on Windows that was fixed by adding a repo.invalidate() in bookmarks.py. I can't find the thread now, and that fix wasn't taken. So Windows may not be getting it all correct either. That said, I just ran the evolve tests, and it seems to have disappeared. (Though I haven't figured out how to run the tests on the repo reliably since it started supporting enabling with evolve=. It seems to want to use the pip installed code.) There are now missing orphan messages similar to above, but these have 'remote:' prefixes, so it's probably an issue of not being flushed, rather than an actual problem.

If you need to throw patches at me to trace through the Windows code to see what's different, feel free.

yuja accepted this revision.Jan 22 2018, 7:45 AM
This revision is now accepted and ready to land.Jan 22 2018, 7:45 AM
This revision was automatically updated to reflect the committed changes.