# HG changeset patch # User Martin von Zweigbergk # Date 1549905143 28800 # Node ID a8d3a4be066e0d3b3d01a90a98dc1907cf4fad3b # Parent 5d383d9636d0b81b416398913b32b8c715e98db5 windows: use util.localpath for repo-relative paths in getuipathfn() Now that we have a single place that translates from internal path representation (slash-separated) to UI representation (i.e. scmutil.getuipathfn()), let's switch that over to using util.localpath for absolute paths. I don't expect any test impact on Windows because we still respect ui.slash, which is set by the test runner. As Yuya pointed out, a997163e7fae (status: extract helper for producing relative or absolute path for UI, 2019-01-29) accidentally changed to slash-separated paths on Windows because it used used to use repo.pathto(f, cwd='') (which calls util.localpath()) and after that patch it just prints the filename without any transformation. This patch should fix that regression. Differential Revision: https://phab.mercurial-scm.org/D5935 diff -r 5d383d9636d0 -r a8d3a4be066e mercurial/scmutil.py --- a/mercurial/scmutil.py Tue Feb 12 17:10:31 2019 -0500 +++ b/mercurial/scmutil.py Mon Feb 11 09:12:23 2019 -0800 @@ -756,8 +756,10 @@ cwd = repo.getcwd() pathto = repo.pathto return lambda f: pathto(f, cwd) + elif repo.ui.configbool('ui', 'slash'): + return lambda f: f else: - return lambda f: f + return util.localpath def subdiruipathfn(subpath, uipathfn): '''Create a new uipathfn that treats the file as relative to subpath.'''