py3: replace file() with open() in test-subrepo-missing.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/D2117
--- a/tests/test-subrepo-missing.t Sun Feb 11 17:01:25 2018 +0530
+++ b/tests/test-subrepo-missing.t Sun Feb 11 17:02:14 2018 +0530
@@ -14,7 +14,7 @@
ignore blanklines in .hgsubstate
- >>> file('.hgsubstate', 'wb').write('\n\n \t \n \n')
+ >>> open('.hgsubstate', 'wb').write(b'\n\n \t \n \n')
$ hg st --subrepos
M .hgsubstate
$ hg revert -qC .hgsubstate
@@ -22,7 +22,7 @@
abort more gracefully on .hgsubstate parsing error
$ cp .hgsubstate .hgsubstate.old
- >>> file('.hgsubstate', 'wb').write('\ninvalid')
+ >>> open('.hgsubstate', 'wb').write(b'\ninvalid')
$ hg st --subrepos --cwd $TESTTMP -R $TESTTMP/repo
abort: invalid subrepository revision specifier in 'repo/.hgsubstate' line 2
[255]