largefiles: reset "lfstatus" attribute to previous value in "finally"
We were resetting it to False, which means nesting of these overrides
would be incorrect.
Differential Revision: https://phab.mercurial-scm.org/D7137
largefiles: add context manager for setting/clearing "lfstatus" attribute
Differential Revision: https://phab.mercurial-scm.org/D7136
py3: adjust expected traceback in test-hook.t
In Python 3, traceback.format_exception() displays the chain of
exceptions so we get extra results from our grep. Also,
ModuleNotFoundError is raised instead of ImportError from Python 3.6.
tests: use non-reverse grep in traceback in test-hook.t
This will prepare for updating test output for Python 3.
py3: add Python 3 exception output to test-hook.t
This is similar to, e.g.,
3e9c6cef949b.