This is an archive of the discontinued Mercurial Phabricator instance.

windows: wrap `os.getcwd()` in `os.path.realpath()` on py3
ClosedPublic

Authored by mharbison72 on Jan 17 2021, 2:18 AM.

Details

Summary

I noticed various test-check-* failures that were printing absolute paths
when repo relative paths were expected. This was due to the drive letter in
repo.root being uppercased as it is run through os.path.realpath(), and then
the simple string comparison against the (lowercased) _cwd member of dirstate
in dirstate.getcwd() causing an absolute path to be returned, instead of the
expected b''. That in turn causes scmutil.getuipathfn() to wrongly use
repo.pathto() with an absolute cwd path.
.

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.