[PATCH 05 of 13] parseindex: implement context manager method on the wrapper

Boris Feld boris.feld at octobus.net
Tue Feb 6 08:21:26 EST 2018


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1517916311 -3600
#      Tue Feb 06 12:25:11 2018 +0100
# Node ID dddbb1b848527a89ca887fdbec25725241efa376
# Parent  53534aa0676becd566238ce945274853526e9823
# EXP-Topic revlog-fp
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r dddbb1b84852
parseindex: implement context manager method on the wrapper

This is needed for incoming cleanups.

diff --git a/tests/test-parseindex.t b/tests/test-parseindex.t
--- a/tests/test-parseindex.t
+++ b/tests/test-parseindex.t
@@ -41,6 +41,13 @@ We approximate that by reducing the read
   >     def __getattr__(self, key):
   >         return getattr(self.real, key)
   > 
+  >     def __enter__(self):
+  >         self.real.__enter__()
+  >         return self
+  > 
+  >     def __exit__(self, *args, **kwargs):
+  >         return self.real.__exit__(*args, **kwargs)
+  > 
   > def opener(*args):
   >     o = vfs.vfs(*args)
   >     def wrapper(*a, **kwargs):


More information about the Mercurial-devel mailing list