diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -20,6 +20,7 @@ from . import ( encoding, error, + pycompat, revlog, util, ) @@ -518,7 +519,7 @@ raise error.RevlogError(_("empty username")) if "\n" in user: raise error.RevlogError(_("username %s contains a newline") - % repr(user)) + % pycompat.bytestr(repr(user))) desc = stripdesc(desc) diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -809,7 +809,7 @@ 'to set your username')) if "\n" in user: raise error.Abort(_("username %s contains a newline\n") - % repr(user)) + % pycompat.bytestr(repr(user))) return user def shortuser(self, user):