diff --git a/tests/test-remotefilelog-histpack.py b/tests/test-remotefilelog-histpack.py --- a/tests/test-remotefilelog-histpack.py +++ b/tests/test-remotefilelog-histpack.py @@ -39,13 +39,14 @@ def makeTempDir(self): tempdir = tempfile.mkdtemp() self.tempdirs.append(tempdir) - return tempdir + return pycompat.fsencode(tempdir) def getHash(self, content): return hashlib.sha1(content).digest() def getFakeHash(self): - return ''.join(chr(random.randint(0, 255)) for _ in range(20)) + return b''.join(pycompat.bytechr(random.randint(0, 255)) + for _ in range(20)) def createPack(self, revisions=None): """Creates and returns a historypack containing the specified revisions. @@ -57,7 +58,7 @@ revisions = [("filename", self.getFakeHash(), nullid, nullid, self.getFakeHash(), None)] - packdir = self.makeTempDir() + packdir = pycompat.fsencode(self.makeTempDir()) packer = historypack.mutablehistorypack(uimod.ui(), packdir, version=2) @@ -111,7 +112,7 @@ chain. """ revisions = [] - filename = "foo" + filename = b"foo" lastnode = nullid for i in range(10): node = self.getFakeHash() @@ -140,7 +141,7 @@ revisions = [] random.seed(0) for i in range(100): - filename = "filename-%s" % i + filename = b"filename-%d" % i entries = [] p2 = nullid linknode = nullid @@ -176,7 +177,7 @@ def testGetNodeInfo(self): revisions = [] - filename = "foo" + filename = b"foo" lastnode = nullid for i in range(10): node = self.getFakeHash() @@ -197,7 +198,7 @@ """Test the getmissing() api. """ revisions = [] - filename = "foo" + filename = b"foo" for i in range(10): node = self.getFakeHash() p1 = self.getFakeHash() @@ -227,7 +228,7 @@ pack = self.createPack() try: - pack.add('filename', nullid, nullid, nullid, nullid, None) + pack.add(b'filename', nullid, nullid, nullid, nullid, None) self.assertTrue(False, "historypack.add should throw") except RuntimeError: pass @@ -254,7 +255,7 @@ total = basepack.SMALLFANOUTCUTOFF + 1 revisions = [] for i in xrange(total): - filename = "foo-%s" % i + filename = b"foo-%d" % i node = self.getFakeHash() p1 = self.getFakeHash() p2 = self.getFakeHash()