Submitter | Laurent Charignon |
---|---|
Date | Jan. 14, 2016, 10:49 p.m. |
Message ID | <6F4EA27D-FBD8-4ACE-A370-79E688627862@fb.com> |
Download | mbox | patch |
Permalink | /patch/12777/ |
State | Changes Requested |
Delegated to: | Pierre-Yves David |
Headers | show |
Comments
Patch
diff --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -7,6 +7,7 @@ from __future__ import absolute_import +from contextlib import contextmanager import imp import os @@ -41,6 +42,13 @@ def extensions(ui=None): if module and enabled(name): yield name, module +@contextmanager +def get(name): + try: + yield find(name) + except KeyError: + pass + Uh, I don't think this is valid. @contextmanager expects *something* to be returned: