py3: convert filename to bytes in test-hardlinks.t
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 09 Dec 2018 13:33:36 -0500
changeset 53634 f79659e1e50fdea654b5111285a4f816104d0b07
parent 53633 109a267acc1efb3b279b6b244d548a0cd4fe5878
child 53635 d3d52cc91e83c3f9200ecacb09ee4a64e04b12b5
push id1079
push usergszorc@mozilla.com
push dateMon, 10 Dec 2018 19:44:59 +0000
py3: convert filename to bytes in test-hardlinks.t Windows was complaining about passing str to CreateFileA() in win32.py.
tests/test-hardlinks.t
--- a/tests/test-hardlinks.t
+++ b/tests/test-hardlinks.t
@@ -1,17 +1,17 @@
 #require hardlink reporevlogstore
 
   $ 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()
   > {
   >     find "$@" -type f | "$PYTHON" $TESTTMP/nlinks.py
   > }
 
 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):