From patchwork Wed May 23 03:43:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: terse: pconvert() entries added to the temporary terse dict for Windows From: Matt Harbison X-Patchwork-Id: 31817 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Tue, 22 May 2018 23:43:24 -0400 # HG changeset patch # User Matt Harbison # Date 1527045735 14400 # Tue May 22 23:22:15 2018 -0400 # Node ID a6bed2a6eafea7d89af7e12696169c754c9bf64a # Parent c65931d23baf101780d00f027bf57dbe0af5e8cc terse: pconvert() entries added to the temporary terse dict for Windows Recent additional testing revealed this problem on Windows: --- tests/test-status.t.err +++ tests/test-status.t.err @@ -109,7 +109,7 @@ tweaking defaults works $ hg status --cwd a --config ui.tweakdefaults=yes - ? . + ? ../a/ ? ../b/ ? ../in_root $ HGPLAIN=1 hg status --cwd a --config ui.tweakdefaults=yes @@ -120,7 +120,7 @@ ? b/in_b (glob) ? in_root $ HGPLAINEXCEPT=tweakdefaults hg status --cwd a --config ui.tweakdefaults=yes - ? . + ? ..\a\ ? ../b/ ? ../in_root (glob) AFAICT, the status list (input and output here) is always in '/' format. The '\' printed output on Windows is because each file is run through repo.pathto() -> dirstate.pathto() -> util.pathto(). (And that function states that the argument uses '/' separators.) I fixed a similar issue in 362096cfdb1f, and given the apparent need for these strings to be in '/' format, I wonder if cmdutil.dirnode() should be rewritten to avoid os.path.join(). But it looks like all entries added to the temporary terse dict should use '/' now, and cmdutil.tersedir() looks like the only user. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -552,7 +552,7 @@ def tersedir(statuslist, terseargs): # process each sub-directory and build tersedict for subdir in rootobj.subdirs.values(): for st, f in subdir.tersewalk(terseargs): - tersedict[st].append(f) + tersedict[st].append(util.pconvert(f)) tersedlist = [] for st in allst: