Patchwork [1,of,2] test-paths: mask out JSON specific path differences for Windows

login
register
mail settings
Submitter Matt Harbison
Date July 14, 2017, 3 a.m.
Message ID <a7a929d086cfb37b63e8.1500001211@Envy>
Download mbox | patch
Permalink /patch/22310/
State Accepted
Headers show

Comments

Matt Harbison - July 14, 2017, 3 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1500000455 14400
#      Thu Jul 13 22:47:35 2017 -0400
# Node ID a7a929d086cfb37b63e8d6d00edc4cff7a9042b7
# Parent  1f3b54f392b0273ad9da180cc45b61917ad68518
test-paths: mask out JSON specific path differences for Windows

The backslashes in the local paths were being escaped with another backslash,
and $TESTTMP doesn't match against the double backslashed path.  This doesn't
happen without the 'json' filter.
Yuya Nishihara - July 14, 2017, 1:05 p.m.
On Thu, 13 Jul 2017 23:00:11 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1500000455 14400
> #      Thu Jul 13 22:47:35 2017 -0400
> # Node ID a7a929d086cfb37b63e8d6d00edc4cff7a9042b7
> # Parent  1f3b54f392b0273ad9da180cc45b61917ad68518
> test-paths: mask out JSON specific path differences for Windows

Ugh, queued. Thanks.

Patch

diff --git a/tests/test-paths.t b/tests/test-paths.t
--- a/tests/test-paths.t
+++ b/tests/test-paths.t
@@ -119,8 +119,8 @@ 
 
  (in JSON, it's a dict of dicts)
 
-  $ hg log -rnull -T '{peerpaths|json}\n'
-  {"dupe": {"pushurl": "https://example.com/dupe", "url": "$TESTTMP/b#tip"}, "expand": {"url": "$TESTTMP/a/$SOMETHING/bar"}} (glob)
+  $ hg log -rnull -T '{peerpaths|json}\n' | sed 's|\\\\|/|g'
+  {"dupe": {"pushurl": "https://example.com/dupe", "url": "$TESTTMP/b#tip"}, "expand": {"url": "$TESTTMP/a/$SOMETHING/bar"}}
 
 password should be masked in plain output, but not in machine-readable/template
 output: