import-checker: allow symbol imports from mercurial.pycompat
Currently, the source transformer inserts
`from mercurial.pycompat import delattr, getattr, hasattr, setattr, open, unicode`
to the top of every file. As part of getting rid of the source transformer,
we'll need to have source code call these wrappers directly. Rather than
rewrite all call sites to call pycompat.*, I think it makes sense to import
needed symbols via explicit imports. That requires loosening the import checker
to allow this.
Differential Revision: https://phab.mercurial-scm.org/D7004
contrib: add a fork of black (as "grey") that includes my changes
This is black with https://github.com/psf/black/pull/826 applied as of
today. The current git hash of black master is
d9e71a75ccfefa3d9156a64c03313a0d4ad981e5, and the hash of my commit is
dc1add6e94e212eff37bb3619e1422fb3c6d8dc8. In order to use this, you
need to install `black` (from github master) and `typed-ast` using
pip, preferably into python3, and then you can run `grey.py` with that
Python and you'll have my patched version of black, which is how we've
been formatting the codebase.
Once my PR is merged, I'll follow up by removing this fork and
updating instructions in the example config.
# no-check-commit bad style
Differential Revision: https://phab.mercurial-scm.org/D7002
rust-cpython: change license of ref_sharing.rs to MIT
Since we plan to upstream this feature, it's better to continue further
refactoring under the same license as rust-cpython crate.
According to the file history, copyright holders are:
- Raphaël Gomès <rgomes@octobus.net>
- Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
- Yuya Nishihara <yuya@tcha.org>
contrib: fix check-code to be able to detect missing _() with bytestrings
Differential Revision: https://phab.mercurial-scm.org/D6997
cleanup: mark some ui.(status|note|warn|write) calls as not needing i18n
These used to be marked with no-op parens, but black removes those now
and this is more explicit.
# skip-blame: fallout from mass reformatting
Differential Revision: https://phab.mercurial-scm.org/D6996
ui: define (write|status|warn|note)noi18n aliases
We currently use `write(('...'))` to suppress check-code warnings
about not using translated strings. However, when we run black, it
will strip the `((...))`. In order to placate black, we'll need to use
a different mechanism to pass untranslatable strings. This commit
introduces a `writenoi18n` alias (and friends) to `write` for that
purpose.
Differential Revision: https://phab.mercurial-scm.org/D6994