# HG changeset patch
# User Matt Harbison <matt_harbi...@yahoo.com>
# Date 1544903706 18000
#      Sat Dec 15 14:55:06 2018 -0500
# Node ID 46761e235265dc2cfb4e8f54c5f7c6f5b7d58906
# Parent  847613113d3ac24106fcd3ca727428b6e02022ae
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 '.'.

diff --git a/mercurial/pure/osutil.py b/mercurial/pure/osutil.py
--- a/mercurial/pure/osutil.py
+++ b/mercurial/pure/osutil.py
@@ -267,7 +267,8 @@ else:
             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)
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to