[PATCH 1 of 5] py3: convert filename to bytes in test-hardlinks.t

Matt Harbison mharbison72 at gmail.com
Mon Dec 10 03:44:33 UTC 2018


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1544380416 18000
#      Sun Dec 09 13:33:36 2018 -0500
# Node ID fa86071307be46ea610dd7620557a10828a1ebc6
# Parent  443eb4bc41af00cafefcf235f15bad24b1ea56a1
py3: convert filename to bytes in test-hardlinks.t

Windows was complaining about passing str to CreateFileA() in win32.py.

diff --git a/tests/test-hardlinks.t b/tests/test-hardlinks.t
--- a/tests/test-hardlinks.t
+++ b/tests/test-hardlinks.t
@@ -3,10 +3,10 @@
   $ cat > nlinks.py <<EOF
   > from __future__ import print_function
   > import sys
-  > from mercurial import util
+  > from mercurial import pycompat, util
   > for f in sorted(sys.stdin.readlines()):
   >     f = f[:-1]
-  >     print(util.nlinks(f), f)
+  >     print(util.nlinks(pycompat.fsencode(f)), f)
   > EOF
 
   $ nlinksdir()


More information about the Mercurial-devel mailing list