# HG changeset patch # User Augie Fackler # Date 2018-04-27 17:27:18 # Node ID 630429dcc3971632c63d723d3f3bbfcc7fad24ff # Parent 2d919ab6c5b4db1dc9348eda93ac58208436f707 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 diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -447,6 +447,7 @@ test-subrepo-missing.t 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 diff --git a/tests/test-symlink-os-yes-fs-no.py b/tests/test-symlink-os-yes-fs-no.py --- a/tests/test-symlink-os-yes-fs-no.py +++ b/tests/test-symlink-os-yes-fs-no.py @@ -6,6 +6,7 @@ import time from mercurial import ( commands, hg, + pycompat, ui as uimod, util, ) @@ -19,13 +20,13 @@ if not getattr(os, "symlink", False): 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 @@ os.path.islink = islink_failure # 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 @@ for f in 'test0/a.lnk', 'test0/d/b.lnk': # 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)