Submitter | phabricator |
---|---|
Date | May 26, 2020, 11:19 a.m. |
Message ID | <differential-rev-PHID-DREV-mmpkompva2ngxctwedq3-req@mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/46378/ |
State | Superseded |
Headers | show |
Comments
Patch
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -803,9 +803,12 @@ if relative: cwd = repo.getcwd() - pathto = repo.pathto - return lambda f: pathto(f, cwd) - elif repo.ui.configbool(b'ui', b'slash'): + if cwd != b'': + # this branch is correct when cwd == b'', ie cwd = repo root, + # but it's slower + pathto = repo.pathto + return lambda f: pathto(f, cwd) + if repo.ui.configbool(b'ui', b'slash'): return lambda f: f else: return util.localpath