[PATCH 1 of 3] tests: stabilize the sorted output of list-tree.py on Windows

Matt Harbison mharbison72 at gmail.com
Sun Dec 10 20:47:43 UTC 2017


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1512881204 18000
#      Sat Dec 09 23:46:44 2017 -0500
# Node ID d607e334441c01020660497186aa11945bba670e
# Parent  c7d49b87c1ee06b14d72de0ff58018bb10b49220
tests: stabilize the sorted output of list-tree.py on Windows

The test-largefiles-misc.t test was moving 'dir2\' before 'dir\' because while
'/' precedes most of the printable ASCII characters, '\' comes after numbers and
capital letters, among other symbols.

diff --git a/tests/list-tree.py b/tests/list-tree.py
--- a/tests/list-tree.py
+++ b/tests/list-tree.py
@@ -24,4 +24,4 @@
         else:
             yield p
 
-print('\n'.join(sorted(gather())))
+print('\n'.join(sorted(gather(), key=lambda x: x.replace(os.path.sep, '/'))))


More information about the Mercurial-devel mailing list