changeset 37079:736024df4498

util: mark MBTextWrapper as private Makes porting slightly easier.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 22 Mar 2018 21:13:31 +0900
parents b3079fea3838
children bad90b80b315
files mercurial/util.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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