This is an archive of the discontinued Mercurial Phabricator instance.

dirstate: call and cache os.getcwd() in constructor
ClosedPublic

Authored by martinvonz on Feb 11 2019, 12:52 AM.

Details

Summary

I'm about to make scmutil.matchfiles() not pass the root and cwd paths
to match.exact(), since they no longer have any effect. That turned
out to have the surprising effect of making some tests
(test-rebase-scenario-global.t and test-removeemptydirs.t) crash when
the working directory was removed. The problem was that my patch
removed the call to repo.getcwd(), which caused the current working
directory to not be cached in the dirstate as early as it was
before. This patch fixes that by caching the current working directory
in the dirstate constructor.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped