py3: replace file() with open() in test-import-git.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2124
--- a/tests/test-import-git.t Sun Feb 11 17:08:40 2018 +0530
+++ b/tests/test-import-git.t Sun Feb 11 17:09:37 2018 +0530
@@ -563,10 +563,10 @@
> Mc$`b*O5$Pw00T?_*Z=?k
>
> EOF
- >>> fp = file('binary.diff', 'rb')
+ >>> fp = open('binary.diff', 'rb')
>>> data = fp.read()
>>> fp.close()
- >>> file('binary.diff', 'wb').write(data.replace('\n', '\r\n'))
+ >>> open('binary.diff', 'wb').write(data.replace(b'\n', b'\r\n'))
$ rm binary2
$ hg import --no-commit binary.diff
applying binary.diff