diff -r f99d64e8a4e4 -r f0b6fbea00cf mercurial/patch.py --- a/mercurial/patch.py Thu Mar 22 21:19:31 2018 +0900 +++ b/mercurial/patch.py Thu Mar 22 21:56:20 2018 +0900 @@ -40,7 +40,10 @@ util, vfs as vfsmod, ) -from .utils import dateutil +from .utils import ( + dateutil, + stringutil, +) diffhelpers = policy.importmod(r'diffhelpers') stringio = util.stringio @@ -1461,7 +1464,7 @@ dec.append(util.b85decode(line[1:])[:l]) except ValueError as e: raise PatchError(_('could not decode "%s" binary patch: %s') - % (self._fname, util.forcebytestr(e))) + % (self._fname, stringutil.forcebytestr(e))) line = getline(lr, self.hunk) text = zlib.decompress(''.join(dec)) if len(text) != size: