tests: port test-symlink-os-yes-fs-no.py to Python 3
authorAugie Fackler <augie@google.com>
Fri, 27 Apr 2018 13:27:18 -0400
changeset 37935 630429dcc397
parent 37934 2d919ab6c5b4
child 37936 48378d0e9479
tests: port test-symlink-os-yes-fs-no.py to Python 3 # skip-blame just bytes/str changes Differential Revision: https://phab.mercurial-scm.org/D3524
contrib/python3-whitelist
tests/test-symlink-os-yes-fs-no.py
--- a/contrib/python3-whitelist	Fri Apr 27 13:26:43 2018 -0400
+++ b/contrib/python3-whitelist	Fri Apr 27 13:27:18 2018 -0400
@@ -447,6 +447,7 @@
 test-subrepo-recursion.t
 test-subrepo-relative-path.t
 test-subrepo.t
+test-symlink-os-yes-fs-no.py
 test-symlinks.t
 test-tag.t
 test-tags.t
--- a/tests/test-symlink-os-yes-fs-no.py	Fri Apr 27 13:26:43 2018 -0400
+++ b/tests/test-symlink-os-yes-fs-no.py	Fri Apr 27 13:27:18 2018 -0400
@@ -6,6 +6,7 @@
 from mercurial import (
     commands,
     hg,
+    pycompat,
     ui as uimod,
     util,
 )
@@ -19,13 +20,13 @@
 
 u = uimod.ui.load()
 # hide outer repo
-hg.peer(u, {}, '.', create=True)
+hg.peer(u, {}, b'.', create=True)
 
 # unbundle with symlink support
-hg.peer(u, {}, 'test0', create=True)
+hg.peer(u, {}, b'test0', create=True)
 
-repo = hg.repository(u, 'test0')
-commands.unbundle(u, repo, BUNDLEPATH, update=True)
+repo = hg.repository(u, b'test0')
+commands.unbundle(u, repo, pycompat.fsencode(BUNDLEPATH), update=True)
 
 # wait a bit, or the status call wont update the dirstate
 time.sleep(1)
@@ -42,7 +43,7 @@
 
 # dereference links as if a Samba server has exported this to a
 # Windows client
-for f in 'test0/a.lnk', 'test0/d/b.lnk':
+for f in b'test0/a.lnk', b'test0/d/b.lnk':
     os.unlink(f)
     fp = open(f, 'wb')
     fp.write(util.readfile(f[:-4]))
@@ -50,11 +51,11 @@
 
 # reload repository
 u = uimod.ui.load()
-repo = hg.repository(u, 'test0')
+repo = hg.repository(u, b'test0')
 commands.status(u, repo)
 
 # try unbundling a repo which contains symlinks
 u = uimod.ui.load()
 
-repo = hg.repository(u, 'test1', create=True)
-commands.unbundle(u, repo, BUNDLEPATH, update=True)
+repo = hg.repository(u, b'test1', create=True)
+commands.unbundle(u, repo, pycompat.fsencode(BUNDLEPATH), update=True)