--- a/hgext3rd/evolve/obsdiscovery.py Mon Jan 20 22:52:05 2020 +0700
+++ b/hgext3rd/evolve/obsdiscovery.py Tue Jan 21 23:48:41 2020 +0700
@@ -33,7 +33,12 @@
util,
)
from mercurial.i18n import _
-from mercurial.utils import stringutil
+
+try:
+ from mercurial.utils.stringutil import forcebytestr
+except ImportError:
+ # hg <= 4.5 (f99d64e8a4e4)
+ from mercurial.util import forcebytestr
from . import (
compat,
@@ -450,7 +455,7 @@
except (sqlite3.DatabaseError, sqlite3.OperationalError) as exc:
repo.ui.log(b'evoext-cache',
b'error while updating obshashrange cache: %s'
- % stringutil.forcebytestr(exc))
+ % forcebytestr(exc))
del self._updating
return
@@ -556,9 +561,9 @@
self._new.clear()
repo.ui.log(b'evoext-cache',
b'error while saving new data: %s'
- % stringutil.forcebytestr(exc))
+ % forcebytestr(exc))
repo.ui.debug(b'evoext-cache: error while saving new data: %s'
- % stringutil.forcebytestr(exc))
+ % forcebytestr(exc))
def _trysave(self, repo):
if self._con is None: