[PATCH] tests: correct the remaining fallout from recent path style changes on Windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] tests: correct the remaining fallout from recent path style changes on Windows

Matt Harbison-2
# HG changeset patch
# User Matt Harbison <[hidden email]>
# Date 1550461152 18000
#      Sun Feb 17 22:39:12 2019 -0500
# Node ID 8e0644d0b8d262c19029fc43c4f8d08ff2571bb1
# Parent  99ed0ac693fb7c6045ecf69cf17909e8dc48a85a
tests: correct the remaining fallout from recent path style changes on Windows

Per @martinvonz, `ui.slash` set by the test runner is now capable of playing a
more active role.[1]  I verified that both of these work by setting `ui.slash`
to False, but these changes seem cleaner.  The problem with check-perf-code.py
was that the proper imports were not being whitelisted due to '\' vs '/'.

[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2019-February/128701.html

diff --git a/tests/check-perf-code.py b/tests/check-perf-code.py
--- a/tests/check-perf-code.py
+++ b/tests/check-perf-code.py
@@ -24,7 +24,7 @@ perfpypats = [
 
 def modulewhitelist(names):
     replacement = [('.py', ''), ('.c', ''), # trim suffix
-                   ('mercurial%s' % (os.sep), ''), # trim "mercurial/" path
+                   ('mercurial%s' % ('/'), ''), # trim "mercurial/" path
                   ]
     ignored = {'__init__'}
     modules = {}
diff --git a/tests/test-hgignore.t b/tests/test-hgignore.t
--- a/tests/test-hgignore.t
+++ b/tests/test-hgignore.t
@@ -356,7 +356,7 @@ Windows paths are accepted on input
   $ rm dir1/.hgignore
   $ echo "dir1/file*" >> .hgignore
   $ hg debugignore "dir1\file2"
-  dir1\file2 is ignored
+  dir1/file2 is ignored
   (ignore rule in $TESTTMP\ignorerepo\.hgignore, line 4: 'dir1/file*')
   $ hg up -qC .
 
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] tests: correct the remaining fallout from recent path style changes on Windows

Martin von Zweigbergk via Mercurial-devel


On Sun, Feb 17, 2019 at 7:45 PM Matt Harbison <[hidden email]> wrote:
# HG changeset patch
# User Matt Harbison <[hidden email]>
# Date 1550461152 18000
#      Sun Feb 17 22:39:12 2019 -0500
# Node ID 8e0644d0b8d262c19029fc43c4f8d08ff2571bb1
# Parent  99ed0ac693fb7c6045ecf69cf17909e8dc48a85a
tests: correct the remaining fallout from recent path style changes on Windows

Queued, thanks. I agree that this is better than setting ui.slash in the test case.

_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel