Mercurial > hg-stable
view tests/test-extensions-wrapfunction.py.out @ 34032: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 source
wrap 0: [0, 'orig'] wrap 1: [1, 0, 'orig'] wrap 2: [2, 1, 0, 'orig'] wrap 3: [3, 2, 1, 0, 'orig'] wrap 4: [4, 3, 2, 1, 0, 'orig'] wrap 0: [0, 4, 3, 2, 1, 0, 'orig'] unwrap 3: 3: [0, 4, 2, 1, 0, 'orig'] unwrap -: 0: [4, 2, 1, 0, 'orig'] unwrap 0: 0: [4, 2, 1, 'orig'] unwrap 4: 4: [2, 1, 'orig'] unwrap 0: -: ValueError 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']