tests: port test-filelog.py to Python 3
# skip-blame just some bytes prefixes
Differential Revision: https://phab.mercurial-scm.org/D3522
--- a/contrib/python3-whitelist Fri Apr 27 13:15:16 2018 -0400
+++ b/contrib/python3-whitelist Fri Apr 27 13:17:24 2018 -0400
@@ -153,6 +153,7 @@
test-extra-filelog-entry.t
test-filebranch.t
test-filecache.py
+test-filelog.py
test-fileset-generated.t
test-fix-topology.t
test-flags.t
--- a/tests/test-filelog.py Fri Apr 27 13:15:16 2018 -0400
+++ b/tests/test-filelog.py Fri Apr 27 13:17:24 2018 -0400
@@ -14,21 +14,21 @@
)
myui = uimod.ui.load()
-repo = hg.repository(myui, path='.', create=True)
+repo = hg.repository(myui, path=b'.', create=True)
-fl = repo.file('foobar')
+fl = repo.file(b'foobar')
def addrev(text, renamed=False):
if renamed:
# data doesn't matter. Just make sure filelog.renamed() returns True
- meta = {'copyrev': hex(nullid), 'copy': 'bar'}
+ meta = {b'copyrev': hex(nullid), b'copy': b'bar'}
else:
meta = {}
lock = t = None
try:
lock = repo.lock()
- t = repo.transaction('commit')
+ t = repo.transaction(b'commit')
node = fl.add(text, meta, t, 0, nullid, nullid)
return node
finally:
@@ -40,8 +40,8 @@
def error(text):
print('ERROR: ' + text)
-textwith = '\1\nfoo'
-without = 'foo'
+textwith = b'\1\nfoo'
+without = b'foo'
node = addrev(textwith)
if not textwith == fl.read(node):