##// END OF EJS Templates
tests: enforce the use of `from __future__ import annotations`...
tests: enforce the use of `from __future__ import annotations` A recent MR and a separate recently landed MR that extracted code to a new file overlooked this, so I think it's worth flagging to ensure consistency. We don't enforce the import for empty files (like `__init__.py`). I'd rather this go into `import-checker.py`, but the import of interest only happens at the top of the file, and its `verify_modern_convention()` calls itself recursively as it transits the AST where the annotations might be. After a few hours of hacking on trying to get it to enforce the import, but only if annotations are used in the module (we generally don't have or check annotations in test files, so don't need this import), I gave up and resorted to this. It won't handle multi-line imports, but this isn't something I'd expect to change often, so this is good enough for now.

File last commit:

r52756:f4733654 default
r53246:662b08ac default
Show More
mergeutil.py
19 lines | 498 B | text/x-python | PythonLexer
# mergeutil.py - help for merge processing in mercurial
#
# Copyright 2005-2007 Olivia Mackall <olivia@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import annotations
from .i18n import _
from . import error
def checkunresolved(ms):
if ms.unresolvedcount():
raise error.StateError(
_(b"unresolved merge conflicts (see 'hg help resolve')")
)