D6996: cleanup: mark some ui.(status|note|warn|write) calls as not needing i18n

2019-10-06 Thread durin42 (Augie Fackler)
Closed by commit rHG86e4daa2d54c: cleanup: mark some 
ui.(status|note|warn|write) calls as not needing i18n (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6996?vs=16901&id=16907

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6996/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6996

AFFECTED FILES
  contrib/debugshell.py
  contrib/perf.py
  doc/check-seclevel.py
  hgext/convert/cvsps.py
  hgext/hgk.py
  hgext/keyword.py
  hgext/phabricator.py
  hgext/remotefilelog/debugcommands.py
  hgext/show.py
  hgext/win32mbcs.py
  mercurial/bundle2.py
  mercurial/debugcommands.py
  mercurial/dispatch.py
  mercurial/sslutil.py
  tests/blackbox-readonly-dispatch.py
  tests/test-ui-color.py

CHANGE DETAILS

diff --git a/tests/test-ui-color.py b/tests/test-ui-color.py
--- a/tests/test-ui-color.py
+++ b/tests/test-ui-color.py
@@ -10,8 +10,8 @@
 # ensure errors aren't buffered
 testui = uimod.ui()
 testui.pushbuffer()
-testui.write(b'buffered\n')
-testui.warn(b'warning\n')
+testui.writenoi18n(b'buffered\n')
+testui.warnnoi18n(b'warning\n')
 testui.write_err(b'error\n')
 print(stringutil.pprint(testui.popbuffer(), bprefix=True).decode('ascii'))
 
diff --git a/tests/blackbox-readonly-dispatch.py 
b/tests/blackbox-readonly-dispatch.py
--- a/tests/blackbox-readonly-dispatch.py
+++ b/tests/blackbox-readonly-dispatch.py
@@ -14,10 +14,10 @@
 """
 ui = uimod.ui.load()
 extensions.populateui(ui)
-ui.status(b"running: %s\n" % cmd)
+ui.statusnoi18n(b"running: %s\n" % cmd)
 req = dispatch.request(cmd.split(), ui)
 result = dispatch.dispatch(req)
-ui.status(b"result: %r\n" % result)
+ui.statusnoi18n(b"result: %r\n" % result)
 
 
 # create file 'foo', add and commit
diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -383,11 +383,11 @@
 sslkeylog.set_keylog(
 pycompat.fsdecode(encoding.environ[b'SSLKEYLOGFILE'])
 )
-ui.warn(
+ui.warnnoi18n(
 b'sslkeylog enabled by SSLKEYLOGFILE environment variable\n'
 )
 except ImportError:
-ui.warn(
+ui.warnnoi18n(
 b'sslkeylog module missing, '
 b'but SSLKEYLOGFILE set in environment\n'
 )
diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -93,7 +93,7 @@
 except:  # re-raises below
 if exc is None:
 exc = sys.exc_info()[1]
-self.ui.warn(b'error in exit handlers:\n')
+self.ui.warnnoi18n(b'error in exit handlers:\n')
 self.ui.traceback(force=True)
 finally:
 if exc is not None:
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -304,7 +304,7 @@
 def _debugchangegroup(ui, gen, all=None, indent=0, **opts):
 indent_string = b' ' * indent
 if all:
-ui.write(
+ui.writenoi18n(
 b"%sformat: id, p1, p2, cset, delta base, len(delta)\n"
 % indent_string
 )
@@ -438,12 +438,12 @@
 opts = pycompat.byteskwargs(opts)
 peer = hg.peer(ui, opts, path)
 caps = peer.capabilities()
-ui.write(b'Main capabilities:\n')
+ui.writenoi18n(b'Main capabilities:\n')
 for c in sorted(caps):
 ui.write(b'  %s\n' % c)
 b2caps = bundle2.bundle2caps(peer)
 if b2caps:
-ui.write(b'Bundle2 capabilities:\n')
+ui.writenoi18n(b'Bundle2 capabilities:\n')
 for key, values in sorted(b2caps.iteritems()):
 ui.write(b'  %s\n' % key)
 for v in values:
@@ -487,7 +487,7 @@
 )
 def debugcolor(ui, repo, **opts):
 """show available color, effects or style"""
-ui.write(b'color mode: %s\n' % stringutil.pprint(ui._colormode))
+ui.writenoi18n(b'color mode: %s\n' % stringutil.pprint(ui._colormode))
 if opts.get(r'style'):
 return _debugdisplaystyle(ui)
 else:
@@ -651,11 +651,11 @@
 d = dateutil.parsedate(date, util.extendeddateformats)
 else:
 d = dateutil.parsedate(date)
-ui.write(b"internal: %d %d\n" % d)
-ui.write(b"standard: %s\n" % dateutil.datestr(d))
+ui.writenoi18n(b"internal: %d %d\n" % d)
+ui.writenoi18n(b"standard: %s\n" % dateutil.datestr(d))
 if range:
 m = dateutil.matchdate(range)
-ui.write(b"match: %s\n" % m(d[0]))
+ui.writenoi18n(b"match: %s\n" % m(d[0]))
 
 
 @command(
@@ -922,7 +922,7 @@
 )
 common = set(common)
 if not opts.get(b'nonheads'):
-ui.write(
+ui.writenoi18n(
 b"unpruned common: %s\n"
 % 

D6996: cleanup: mark some ui.(status|note|warn|write) calls as not needing i18n

2019-10-06 Thread durin42 (Augie Fackler)
durin42 edited the summary of this revision.
durin42 updated this revision to Diff 16901.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6996?vs=16887&id=16901

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6996/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6996

AFFECTED FILES
  contrib/debugshell.py
  contrib/perf.py
  doc/check-seclevel.py
  hgext/convert/cvsps.py
  hgext/hgk.py
  hgext/keyword.py
  hgext/phabricator.py
  hgext/remotefilelog/debugcommands.py
  hgext/show.py
  hgext/win32mbcs.py
  mercurial/bundle2.py
  mercurial/debugcommands.py
  mercurial/dispatch.py
  mercurial/sslutil.py
  tests/blackbox-readonly-dispatch.py
  tests/test-ui-color.py

CHANGE DETAILS

diff --git a/tests/test-ui-color.py b/tests/test-ui-color.py
--- a/tests/test-ui-color.py
+++ b/tests/test-ui-color.py
@@ -10,8 +10,8 @@
 # ensure errors aren't buffered
 testui = uimod.ui()
 testui.pushbuffer()
-testui.write(b'buffered\n')
-testui.warn(b'warning\n')
+testui.writenoi18n(b'buffered\n')
+testui.warnnoi18n(b'warning\n')
 testui.write_err(b'error\n')
 print(stringutil.pprint(testui.popbuffer(), bprefix=True).decode('ascii'))
 
diff --git a/tests/blackbox-readonly-dispatch.py 
b/tests/blackbox-readonly-dispatch.py
--- a/tests/blackbox-readonly-dispatch.py
+++ b/tests/blackbox-readonly-dispatch.py
@@ -14,10 +14,10 @@
 """
 ui = uimod.ui.load()
 extensions.populateui(ui)
-ui.status(b"running: %s\n" % cmd)
+ui.statusnoi18n(b"running: %s\n" % cmd)
 req = dispatch.request(cmd.split(), ui)
 result = dispatch.dispatch(req)
-ui.status(b"result: %r\n" % result)
+ui.statusnoi18n(b"result: %r\n" % result)
 
 
 # create file 'foo', add and commit
diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -383,11 +383,11 @@
 sslkeylog.set_keylog(
 pycompat.fsdecode(encoding.environ[b'SSLKEYLOGFILE'])
 )
-ui.warn(
+ui.warnnoi18n(
 b'sslkeylog enabled by SSLKEYLOGFILE environment variable\n'
 )
 except ImportError:
-ui.warn(
+ui.warnnoi18n(
 b'sslkeylog module missing, '
 b'but SSLKEYLOGFILE set in environment\n'
 )
diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -93,7 +93,7 @@
 except:  # re-raises below
 if exc is None:
 exc = sys.exc_info()[1]
-self.ui.warn(b'error in exit handlers:\n')
+self.ui.warnnoi18n(b'error in exit handlers:\n')
 self.ui.traceback(force=True)
 finally:
 if exc is not None:
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -304,7 +304,7 @@
 def _debugchangegroup(ui, gen, all=None, indent=0, **opts):
 indent_string = b' ' * indent
 if all:
-ui.write(
+ui.writenoi18n(
 b"%sformat: id, p1, p2, cset, delta base, len(delta)\n"
 % indent_string
 )
@@ -438,12 +438,12 @@
 opts = pycompat.byteskwargs(opts)
 peer = hg.peer(ui, opts, path)
 caps = peer.capabilities()
-ui.write(b'Main capabilities:\n')
+ui.writenoi18n(b'Main capabilities:\n')
 for c in sorted(caps):
 ui.write(b'  %s\n' % c)
 b2caps = bundle2.bundle2caps(peer)
 if b2caps:
-ui.write(b'Bundle2 capabilities:\n')
+ui.writenoi18n(b'Bundle2 capabilities:\n')
 for key, values in sorted(b2caps.iteritems()):
 ui.write(b'  %s\n' % key)
 for v in values:
@@ -487,7 +487,7 @@
 )
 def debugcolor(ui, repo, **opts):
 """show available color, effects or style"""
-ui.write(b'color mode: %s\n' % stringutil.pprint(ui._colormode))
+ui.writenoi18n(b'color mode: %s\n' % stringutil.pprint(ui._colormode))
 if opts.get(r'style'):
 return _debugdisplaystyle(ui)
 else:
@@ -651,11 +651,11 @@
 d = dateutil.parsedate(date, util.extendeddateformats)
 else:
 d = dateutil.parsedate(date)
-ui.write(b"internal: %d %d\n" % d)
-ui.write(b"standard: %s\n" % dateutil.datestr(d))
+ui.writenoi18n(b"internal: %d %d\n" % d)
+ui.writenoi18n(b"standard: %s\n" % dateutil.datestr(d))
 if range:
 m = dateutil.matchdate(range)
-ui.write(b"match: %s\n" % m(d[0]))
+ui.writenoi18n(b"match: %s\n" % m(d[0]))
 
 
 @command(
@@ -922,7 +922,7 @@
 )
 common = set(common)
 if not opts.get(b'nonheads'):
-ui.write(
+ui.writenoi18n(
 b"unpruned common: %s\n"
 % b" ".join(sorted(short(n) for n in common))
 )
@@ -969,24 +969,24 @@
 data[b'nb-revs-missing'] 

D6996: cleanup: mark some ui.(status|note|warn|write) calls as not needing i18n

2019-10-06 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added subscribers: mercurial-devel, Kwan, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  These used to be marked with no-op parens, but black removes those now
  and this is more explicit.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6996

AFFECTED FILES
  contrib/debugshell.py
  contrib/perf.py
  doc/check-seclevel.py
  hgext/convert/cvsps.py
  hgext/hgk.py
  hgext/keyword.py
  hgext/phabricator.py
  hgext/remotefilelog/debugcommands.py
  hgext/show.py
  hgext/win32mbcs.py
  mercurial/bundle2.py
  mercurial/debugcommands.py
  mercurial/dispatch.py
  mercurial/sslutil.py
  tests/blackbox-readonly-dispatch.py
  tests/test-ui-color.py

CHANGE DETAILS

diff --git a/tests/test-ui-color.py b/tests/test-ui-color.py
--- a/tests/test-ui-color.py
+++ b/tests/test-ui-color.py
@@ -10,8 +10,8 @@
 # ensure errors aren't buffered
 testui = uimod.ui()
 testui.pushbuffer()
-testui.write(b'buffered\n')
-testui.warn(b'warning\n')
+testui.writenoi18n(b'buffered\n')
+testui.warnnoi18n(b'warning\n')
 testui.write_err(b'error\n')
 print(stringutil.pprint(testui.popbuffer(), bprefix=True).decode('ascii'))
 
diff --git a/tests/blackbox-readonly-dispatch.py 
b/tests/blackbox-readonly-dispatch.py
--- a/tests/blackbox-readonly-dispatch.py
+++ b/tests/blackbox-readonly-dispatch.py
@@ -14,10 +14,10 @@
 """
 ui = uimod.ui.load()
 extensions.populateui(ui)
-ui.status(b"running: %s\n" % cmd)
+ui.statusnoi18n(b"running: %s\n" % cmd)
 req = dispatch.request(cmd.split(), ui)
 result = dispatch.dispatch(req)
-ui.status(b"result: %r\n" % result)
+ui.statusnoi18n(b"result: %r\n" % result)
 
 
 # create file 'foo', add and commit
diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -383,11 +383,11 @@
 sslkeylog.set_keylog(
 pycompat.fsdecode(encoding.environ[b'SSLKEYLOGFILE'])
 )
-ui.warn(
+ui.warnnoi18n(
 b'sslkeylog enabled by SSLKEYLOGFILE environment variable\n'
 )
 except ImportError:
-ui.warn(
+ui.warnnoi18n(
 b'sslkeylog module missing, '
 b'but SSLKEYLOGFILE set in environment\n'
 )
diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -93,7 +93,7 @@
 except:  # re-raises below
 if exc is None:
 exc = sys.exc_info()[1]
-self.ui.warn(b'error in exit handlers:\n')
+self.ui.warnnoi18n(b'error in exit handlers:\n')
 self.ui.traceback(force=True)
 finally:
 if exc is not None:
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -304,7 +304,7 @@
 def _debugchangegroup(ui, gen, all=None, indent=0, **opts):
 indent_string = b' ' * indent
 if all:
-ui.write(
+ui.writenoi18n(
 b"%sformat: id, p1, p2, cset, delta base, len(delta)\n"
 % indent_string
 )
@@ -438,12 +438,12 @@
 opts = pycompat.byteskwargs(opts)
 peer = hg.peer(ui, opts, path)
 caps = peer.capabilities()
-ui.write(b'Main capabilities:\n')
+ui.writenoi18n(b'Main capabilities:\n')
 for c in sorted(caps):
 ui.write(b'  %s\n' % c)
 b2caps = bundle2.bundle2caps(peer)
 if b2caps:
-ui.write(b'Bundle2 capabilities:\n')
+ui.writenoi18n(b'Bundle2 capabilities:\n')
 for key, values in sorted(b2caps.iteritems()):
 ui.write(b'  %s\n' % key)
 for v in values:
@@ -487,7 +487,7 @@
 )
 def debugcolor(ui, repo, **opts):
 """show available color, effects or style"""
-ui.write(b'color mode: %s\n' % stringutil.pprint(ui._colormode))
+ui.writenoi18n(b'color mode: %s\n' % stringutil.pprint(ui._colormode))
 if opts.get(r'style'):
 return _debugdisplaystyle(ui)
 else:
@@ -651,11 +651,11 @@
 d = dateutil.parsedate(date, util.extendeddateformats)
 else:
 d = dateutil.parsedate(date)
-ui.write(b"internal: %d %d\n" % d)
-ui.write(b"standard: %s\n" % dateutil.datestr(d))
+ui.writenoi18n(b"internal: %d %d\n" % d)
+ui.writenoi18n(b"standard: %s\n" % dateutil.datestr(d))
 if range:
 m = dateutil.matchdate(range)
-ui.write(b"match: %s\n" % m(d[0]))
+ui.writenoi18n(b"match: %s\n" % m(d[0]))
 
 
 @command(
@@ -922,7 +922,7 @@
 )
 common = set(common)
 if not opts.get(b'nonheads'):
-ui.write(
+ui.writenoi18n(
 b"unpruned common: %s\n"
 % b" ".join(sorted(short(n) for n in common))
 )
@@ -969,24 +969,24 @@
 data[b'nb-revs-missi