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

login
register
mail settings
Submitter Boris Feld
Date Feb. 6, 2018, 1:21 p.m.
Message ID <dddbb1b848527a89ca88.1517923286@FB>
Download mbox | patch
Permalink /patch/27357/
State New
Headers show

Comments

Boris Feld - Feb. 6, 2018, 1:21 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@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.

Patch

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):