##// END OF EJS Templates
cleanup: mark some ui.(status|note|warn|write) calls as not needing i18n...
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

File last commit:

r43350:86e4daa2 default
r43350:86e4daa2 default
Show More
test-ui-color.py
39 lines | 1023 B | text/x-python | PythonLexer
Pulkit Goyal
tests: make test-ui-color use absolute_import
r28915 from __future__ import absolute_import, print_function
Simon Heimberg
cleanup: remove unused imports...
r19322 import os
Pulkit Goyal
tests: make test-ui-color use absolute_import
r28915 from mercurial import (
dispatch,
ui as uimod,
)
Augie Fackler
formatting: blacken the codebase...
r43346 from mercurial.utils import stringutil
Brodie Rao
color: call correct superclass method in write_err...
r11732
# ensure errors aren't buffered
Pierre-Yves David
color: drop the 'colorui' class...
r31095 testui = uimod.ui()
Brodie Rao
color: call correct superclass method in write_err...
r11732 testui.pushbuffer()
Augie Fackler
cleanup: mark some ui.(status|note|warn|write) calls as not needing i18n...
r43350 testui.writenoi18n(b'buffered\n')
testui.warnnoi18n(b'warning\n')
Pulkit Goyal
py3: add b'' to test-ui-color.py...
r36354 testui.write_err(b'error\n')
Yuya Nishihara
stringutil: flip the default of pprint() to bprefix=False...
r37961 print(stringutil.pprint(testui.popbuffer(), bprefix=True).decode('ascii'))
Idan Kamara
color: check if ui is already a subclass of colorui before wrapping it...
r14516
# test dispatch.dispatch with the same ui object
Pulkit Goyal
py3: make sure we open file in bytes mode...
r36355 hgrc = open(os.environ["HGRCPATH"], 'wb')
Pulkit Goyal
py3: add b'' to test-ui-color.py...
r36354 hgrc.write(b'[extensions]\n')
hgrc.write(b'color=\n')
Idan Kamara
color: check if ui is already a subclass of colorui before wrapping it...
r14516 hgrc.close()
Yuya Nishihara
ui: factor out ui.load() to create a ui without loading configs (API)...
r30559 ui_ = uimod.ui.load()
Pulkit Goyal
py3: add b'' to test-ui-color.py...
r36354 ui_.setconfig(b'ui', b'formatted', b'True')
Idan Kamara
color: check if ui is already a subclass of colorui before wrapping it...
r14516
Idan Kamara
ui: use I/O descriptors internally...
r14614 # we're not interested in the output, so write that to devnull
Pulkit Goyal
py3: make sure we open file in bytes mode...
r36355 ui_.fout = open(os.devnull, 'wb')
Idan Kamara
ui: use I/O descriptors internally...
r14614
Idan Kamara
color: check if ui is already a subclass of colorui before wrapping it...
r14516 # call some arbitrary command just so we go through
# color's wrapped _runcommand twice.
def runcmd():
Pulkit Goyal
py3: add b'' to test-ui-color.py...
r36354 dispatch.dispatch(dispatch.request([b'version', b'-q'], ui_))
Idan Kamara
color: check if ui is already a subclass of colorui before wrapping it...
r14516
Augie Fackler
formatting: blacken the codebase...
r43346
Idan Kamara
color: check if ui is already a subclass of colorui before wrapping it...
r14516 runcmd()
Pierre-Yves David
color: drop the 'colorui' class...
r31095 print("colored? %s" % (ui_._colormode is not None))
Idan Kamara
color: check if ui is already a subclass of colorui before wrapping it...
r14516 runcmd()
Pierre-Yves David
color: drop the 'colorui' class...
r31095 print("colored? %s" % (ui_._colormode is not None))