Mercurial > public > mercurial-scm > hg
diff tests/test-extensions-wrapfunction.py.out @ 34014:47e52f079a57
extensions: add wrappedfunction() context manager
Several extensions exist that temporarily want to wrap a function (at
least narrowhg, any many of the extensions in hg-experimental). That's
why we have the unwrapfunction() that was introduced in 19578bb84731
(extensions: add unwrapfunction to undo wrapfunction, 2016-08-10).
This patch adds a simple wrappedfunction() that returns a context
manager.
Differential Revision: https://phab.mercurial-scm.org/D472
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 21 Aug 2017 16:46:05 -0700 |
parents | 19578bb84731 |
children | 82bd4c5a81e5 |
line wrap: on
line diff
--- a/tests/test-extensions-wrapfunction.py.out Tue Aug 29 18:20:50 2017 -0700 +++ b/tests/test-extensions-wrapfunction.py.out Mon Aug 21 16:46:05 2017 -0700 @@ -12,3 +12,9 @@ unwrap 2: 2: [1, 'orig'] unwrap 1: 1: ['orig'] unwrap -: -: IndexError +context manager ['orig'] +context manager [1, 'orig'] +context manager [0, 1, 'orig'] +context manager [2, 0, 1, 'orig'] +context manager [2, 1, 'orig'] +context manager [2, 'orig']