hgext3rd/evolve/stablerangecache.py
changeset 4814 48b30ff742cb
parent 4811 e1dc374909bd
child 4837 b59231359479
--- a/hgext3rd/evolve/stablerangecache.py	Tue Aug 06 15:06:27 2019 +0200
+++ b/hgext3rd/evolve/stablerangecache.py	Tue Aug 06 15:06:38 2019 +0200
@@ -35,7 +35,7 @@
 
 LONG_WARNING_TIME = 60
 
-LONG_MESSAGE = """Stable range cache is taking a while to load
+LONG_MESSAGE = b"""Stable range cache is taking a while to load
 
 Your repository is probably big.
 
@@ -99,8 +99,8 @@
                         warned_long = True
                     if (1 < progress_each) and (0.1 < progress_new - progress_last):
                         progress_each /= 10
-                    compat.progress(ui, _("filling stablerange cache"), seen,
-                                    total=total, unit=_("changesets"))
+                    compat.progress(ui, _(b"filling stablerange cache"), seen,
+                                    total=total, unit=_(b"changesets"))
                     progress_last = progress_new
                 seen += 1
                 original.remove(rangeid) # might have been added from other source
@@ -109,7 +109,7 @@
                 for sub in self.subranges(repo, rangeid):
                     if self._getsub(sub) is None:
                         heappush(rangeheap, sub)
-        compat.progress(ui, _("filling stablerange cache"), None, total=total)
+        compat.progress(ui, _(b"filling stablerange cache"), None, total=total)
 
     def clear(self, reset=False):
         super(stablerangeondiskbase, self).clear()
@@ -281,8 +281,8 @@
             if r'_con' in vars(self):
                 del self._con
             self._unsavedsubranges.clear()
-            repo.ui.log('evoext-cache', 'error while saving new data: %s' % exc)
-            repo.ui.debug('evoext-cache: error while saving new data: %s' % exc)
+            repo.ui.log(b'evoext-cache', b'error while saving new data: %s' % exc)
+            repo.ui.debug(b'evoext-cache: error while saving new data: %s' % exc)
 
     def _trysave(self, repo):
         repo = repo.unfiltered()
@@ -319,9 +319,9 @@
                 # drifting is currently an issue because this means another
                 # process might have already added the cache line we are about
                 # to add. This will confuse sqlite
-                msg = _('stable-range cache: skipping write, '
-                        'database drifted under my feet\n')
-                hint = _('(disk: %s-%s vs mem: %s-%s)\n')
+                msg = _(b'stable-range cache: skipping write, '
+                        b'database drifted under my feet\n')
+                hint = _(b'(disk: %s-%s vs mem: %s-%s)\n')
                 data = (nodemod.hex(meta[2]), meta[1],
                         nodemod.hex(self._ondisktipnode), self._ondisktiprev)
                 repo.ui.warn(msg)
@@ -396,13 +396,13 @@
 class mergepointsql(stablerangesql, stablerange.stablerange_mergepoint):
 
     _schemaversion = 3
-    _cachefile = 'evoext_stablerange_v2.sqlite'
-    _cachename = 'evo-ext-stablerange-mergepoint'
+    _cachefile = b'evoext_stablerange_v2.sqlite'
+    _cachename = b'evo-ext-stablerange-mergepoint'
 
 class sqlstablerange(stablerangesqlbase, stablerange.stablerange):
 
     _schemaversion = 1
-    _cachefile = 'evoext_stablerange_v1.sqlite'
+    _cachefile = b'evoext_stablerange_v1.sqlite'
 
     def warmup(self, repo, upto=None):
         self._con # make sure the data base is loaded
@@ -419,8 +419,8 @@
         except error.LockError:
             # Exceptionnally we are noisy about it since performance impact is
             # large We should address that before using this more widely.
-            repo.ui.warn('stable-range cache: unable to lock repo while warming\n')
-            repo.ui.warn('(cache will not be saved)\n')
+            repo.ui.warn(b'stable-range cache: unable to lock repo while warming\n')
+            repo.ui.warn(b'(cache will not be saved)\n')
             super(sqlstablerange, self).warmup(repo, upto)
 
 @eh.reposetup