diff mercurial/util.py @ 37084:f0b6fbea00cf

stringutil: bulk-replace call sites to point to new module This might conflict with other patches floating around, sorry.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 22 Mar 2018 21:56:20 +0900
parents f99d64e8a4e4
children 7ae6e3529e37
line wrap: on
line diff
--- a/mercurial/util.py	Thu Mar 22 21:19:31 2018 +0900
+++ b/mercurial/util.py	Thu Mar 22 21:56:20 2018 +0900
@@ -820,9 +820,10 @@
         # Simple case writes all data on a single line.
         if b'\n' not in data:
             if self.logdataapis:
-                self.fh.write(': %s\n' % escapedata(data))
+                self.fh.write(': %s\n' % stringutil.escapedata(data))
             else:
-                self.fh.write('%s>     %s\n' % (self.name, escapedata(data)))
+                self.fh.write('%s>     %s\n'
+                              % (self.name, stringutil.escapedata(data)))
             self.fh.flush()
             return
 
@@ -832,7 +833,8 @@
 
         lines = data.splitlines(True)
         for line in lines:
-            self.fh.write('%s>     %s\n' % (self.name, escapedata(line)))
+            self.fh.write('%s>     %s\n'
+                          % (self.name, stringutil.escapedata(line)))
         self.fh.flush()
 
 class fileobjectobserver(baseproxyobserver):
@@ -1915,7 +1917,7 @@
                          "on Windows") % c
             if ord(c) <= 31:
                 return _("filename contains '%s', which is invalid "
-                         "on Windows") % escapestr(c)
+                         "on Windows") % stringutil.escapestr(c)
         base = n.split('.')[0]
         if base and base.lower() in _winreservednames:
             return _("filename contains '%s', which is reserved "
@@ -3679,7 +3681,7 @@
                 return zlib.decompress(data)
             except zlib.error as e:
                 raise error.RevlogError(_('revlog decompress error: %s') %
-                                        forcebytestr(e))
+                                        stringutil.forcebytestr(e))
 
     def revlogcompressor(self, opts=None):
         return self.zlibrevlogcompressor()
@@ -3905,7 +3907,7 @@
                 return ''.join(chunks)
             except Exception as e:
                 raise error.RevlogError(_('revlog decompress error: %s') %
-                                        forcebytestr(e))
+                                        stringutil.forcebytestr(e))
 
     def revlogcompressor(self, opts=None):
         opts = opts or {}