diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -1058,7 +1058,7 @@ elif isinstance(bundle, streamclone.streamcloneapplier): raise error.Abort(b'stream clone bundles not supported') else: - raise error.Abort(b'unhandled bundle type: %s' % type(bundle)) + raise error.Abort(b'unhandled bundle type: %r' % type(bundle)) for fn, title in benches: timer, fm = gettimer(ui, opts) diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -295,7 +295,7 @@ self._cgunpacker = bundle else: raise error.Abort( - _(b'bundle type %s cannot be read') % type(bundle) + _(b'bundle type %r cannot be read') % type(bundle) ) # dict with the mapping 'filename' -> position in the changegroup. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1567,7 +1567,7 @@ rev = self.changelog.rev(node) else: raise error.ProgrammingError( - b"unsupported changeid '%s' of type %s" + b"unsupported changeid '%r' of type %r" % (changeid, pycompat.sysstr(type(changeid))) ) diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -597,7 +597,7 @@ """ if not isinstance(symbol, bytes): msg = ( - b"symbol (%s of type %s) was not a string, did you mean " + b"symbol (%r of type %r) was not a string, did you mean " b"repo[symbol]?" % (symbol, type(symbol)) ) raise error.ProgrammingError(msg) diff --git a/mercurial/utils/cborutil.py b/mercurial/utils/cborutil.py --- a/mercurial/utils/cborutil.py +++ b/mercurial/utils/cborutil.py @@ -241,7 +241,7 @@ break if not fn: - raise ValueError(b'do not know how to encode %s' % type(v)) + raise ValueError(b'do not know how to encode %r' % type(v)) return fn(v)