mercurial/branchmap.py
changeset 37084 f0b6fbea00cf
parent 36962 95f4f1bfb650
child 39115 2a4bfbb52111
--- a/mercurial/branchmap.py	Thu Mar 22 21:19:31 2018 +0900
+++ b/mercurial/branchmap.py	Thu Mar 22 21:56:20 2018 +0900
@@ -22,6 +22,9 @@
     scmutil,
     util,
 )
+from .utils import (
+    stringutil,
+)
 
 calcsize = struct.calcsize
 pack_into = struct.pack_into
@@ -256,7 +259,7 @@
         except (IOError, OSError, error.Abort) as inst:
             # Abort may be raised by read only opener, so log and continue
             repo.ui.debug("couldn't write branch cache: %s\n" %
-                          util.forcebytestr(inst))
+                          stringutil.forcebytestr(inst))
 
     def update(self, repo, revgen):
         """Given a branchhead cache, self, that may have extra nodes or be
@@ -378,7 +381,7 @@
                 self._rbcrevs[:] = data
             except (IOError, OSError) as inst:
                 repo.ui.debug("couldn't read revision branch cache: %s\n" %
-                              util.forcebytestr(inst))
+                              stringutil.forcebytestr(inst))
         # remember number of good records on disk
         self._rbcrevslen = min(len(self._rbcrevs) // _rbcrecsize,
                                len(repo.changelog))
@@ -540,7 +543,7 @@
                 self._rbcrevslen = revs
         except (IOError, OSError, error.Abort, error.LockError) as inst:
             repo.ui.debug("couldn't write revision branch cache%s: %s\n"
-                          % (step, util.forcebytestr(inst)))
+                          % (step, stringutil.forcebytestr(inst)))
         finally:
             if wlock is not None:
                 wlock.release()