This is an archive of the discontinued Mercurial Phabricator instance.

match: don't util.normpath() cwd
ClosedPublic

Authored by mharbison72 on Dec 26 2019, 7:29 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Commits
rHG8a81fa44f7bb: match: don't util.normpath() cwd
Summary

The problem here is that util.normpath() calls util.pconvert(), which
switches to Unix style separators. That results in two test failures like this
since 5685ce2ea3bf:

    • c:/Users/Matt/hg/tests/test-globalopts.t +++ c:/Users/Matt/hg/tests/test-globalopts.t.err @@ -89,7 +89,7 @@ [255] $ hg -R b ann a/a abort: a/a not under root '$TESTTMP/b'
  • (consider using '--cwd b') + (consider using '--cwd ..\$TESTTMP\b') [255] $ hg log abort: no repository found in '$TESTTMP' (.hg not found)!

    ERROR: test-globalopts.t output changed

Martin originally had os.path.normpath() (which *would* work here too), but
changed it during review. He didn't remember why he thought any form is needed
here. Most uses simply pass '' or repo.getcwd(), so these should generally be
in local format anyway. It seems better if cwd and root use consistent
styles here.

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

mharbison72 created this revision.Dec 26 2019, 7:29 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.