D3524: tests: port test-symlink-os-yes-fs-no.py to Python 3

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu May 10 14:47:11 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGce1b2b143f0f: tests: port test-symlink-os-yes-fs-no.py to Python 3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3524?vs=8618&id=8630

REVISION DETAIL
  https://phab.mercurial-scm.org/D3524

AFFECTED FILES
  tests/test-symlink-os-yes-fs-no.py

CHANGE DETAILS

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 @@
 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,19 +43,19 @@
 
 # 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]))
     fp.close()
 
 # 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)



To: durin42, #hg-reviewers, pulkit
Cc: mercurial-devel


More information about the Mercurial-devel mailing list