util: mark internal constants of escapedata() as private
authorYuya Nishihara <yuya@tcha.org>
Thu, 22 Mar 2018 21:20:47 +0900
changeset 37081 191cba70fe27
parent 37080 bad90b80b315
child 37082 1a1d1c44b570
util: mark internal constants of escapedata() as private
mercurial/util.py
--- a/mercurial/util.py	Thu Mar 22 21:14:12 2018 +0900
+++ b/mercurial/util.py	Thu Mar 22 21:20:47 2018 +0900
@@ -809,19 +809,19 @@
         return object.__getattribute__(self, r'_observedcall')(
             r'setsockopt', *args, **kwargs)
 
-DATA_ESCAPE_MAP = {pycompat.bytechr(i): br'\x%02x' % i for i in range(256)}
-DATA_ESCAPE_MAP.update({
+_DATA_ESCAPE_MAP = {pycompat.bytechr(i): br'\x%02x' % i for i in range(256)}
+_DATA_ESCAPE_MAP.update({
     b'\\': b'\\\\',
     b'\r': br'\r',
     b'\n': br'\n',
 })
-DATA_ESCAPE_RE = remod.compile(br'[\x00-\x08\x0a-\x1f\\\x7f-\xff]')
+_DATA_ESCAPE_RE = remod.compile(br'[\x00-\x08\x0a-\x1f\\\x7f-\xff]')
 
 def escapedata(s):
     if isinstance(s, bytearray):
         s = bytes(s)
 
-    return DATA_ESCAPE_RE.sub(lambda m: DATA_ESCAPE_MAP[m.group(0)], s)
+    return _DATA_ESCAPE_RE.sub(lambda m: _DATA_ESCAPE_MAP[m.group(0)], s)
 
 class baseproxyobserver(object):
     def _writedata(self, data):