util: mark MBTextWrapper as private
authorYuya Nishihara <yuya@tcha.org>
Thu, 22 Mar 2018 21:13:31 +0900
changeset 37082 736024df4498
parent 37081 b3079fea3838
child 37083 bad90b80b315
util: mark MBTextWrapper as private Makes porting slightly easier.
mercurial/util.py
--- 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