windows: ensure pure posixfile fd doesn't escape by entering context manager
There are tests in test-revlog-mmapindex.t and test-rebase-mq-skip.t that are
fixed by this, but we usually don't use --pure on Windows. For whatever reason,
the remaining --pure failures are various errors like $ENOTDIR$ and "Access is
denied" have a trailing '.'.
--- a/mercurial/pure/osutil.py Sat Dec 15 13:54:37 2018 -0500
+++ b/mercurial/pure/osutil.py Sat Dec 15 14:55:06 2018 -0500
@@ -267,7 +267,8 @@
return self._file.__setattr__(name, value)
def __enter__(self):
- return self._file.__enter__()
+ self._file.__enter__()
+ return self
def __exit__(self, exc_type, exc_value, exc_tb):
return self._file.__exit__(exc_type, exc_value, exc_tb)