Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 43079:5209fc94b982
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
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 06 Oct 2019 10:10:14 -0400 |
parents | 687b865b95ad |
children | eef9a2d67051 |
comparison
equal
deleted
inserted
replaced
43078:88eba7103660 | 43079:5209fc94b982 |
---|---|
1699 ''' | 1699 ''' |
1700 if self.debugflag: | 1700 if self.debugflag: |
1701 self._writemsg(self._fmsgout, type=b'debug', *msg, **opts) | 1701 self._writemsg(self._fmsgout, type=b'debug', *msg, **opts) |
1702 self.log(b'debug', b'%s', b''.join(msg)) | 1702 self.log(b'debug', b'%s', b''.join(msg)) |
1703 | 1703 |
1704 # Aliases to defeat check-code. | |
1705 statusnoi18n = status | |
1706 notenoi18n = note | |
1707 warnnoi18n = warn | |
1708 writenoi18n = write | |
1709 | |
1704 def edit( | 1710 def edit( |
1705 self, | 1711 self, |
1706 text, | 1712 text, |
1707 user, | 1713 user, |
1708 extra=None, | 1714 extra=None, |