util: mark MBTextWrapper as private
Makes porting slightly easier.
--- a/mercurial/util.py Thu Mar 22 21:10:42 2018 +0900
+++ b/mercurial/util.py Thu Mar 22 21:13:31 2018 +0900
@@ -2774,7 +2774,7 @@
return pycompat.byterepr(pycompat.bytestr(s)).replace(b'\\\\', b'\\')
# delay import of textwrap
-def MBTextWrapper(**kwargs):
+def _MBTextWrapper(**kwargs):
class tw(textwrap.TextWrapper):
"""
Extend TextWrapper for width-awareness.
@@ -2873,8 +2873,8 @@
return lines
- global MBTextWrapper
- MBTextWrapper = tw
+ global _MBTextWrapper
+ _MBTextWrapper = tw
return tw(**kwargs)
def wrap(line, width, initindent='', hangindent=''):
@@ -2888,9 +2888,9 @@
pycompat.sysstr(encoding.encodingmode))
hangindent = hangindent.decode(pycompat.sysstr(encoding.encoding),
pycompat.sysstr(encoding.encodingmode))
- wrapper = MBTextWrapper(width=width,
- initial_indent=initindent,
- subsequent_indent=hangindent)
+ wrapper = _MBTextWrapper(width=width,
+ initial_indent=initindent,
+ subsequent_indent=hangindent)
return wrapper.fill(line).encode(pycompat.sysstr(encoding.encoding))
if (pyplatform.python_implementation() == 'CPython' and