Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 36228:ddeb7653b31c
py3: use pycompat.bytestr to convert str to bytes
Differential Revision: https://phab.mercurial-scm.org/D2261
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 14 Feb 2018 16:37:46 +0530 |
parents | df1760b58fda |
children | 04c319a07c7b |
comparison
equal
deleted
inserted
replaced
36227:69080ee1fb0e | 36228:ddeb7653b31c |
---|---|
806 if not user: | 806 if not user: |
807 raise error.Abort(_('no username supplied'), | 807 raise error.Abort(_('no username supplied'), |
808 hint=_("use 'hg config --edit' " | 808 hint=_("use 'hg config --edit' " |
809 'to set your username')) | 809 'to set your username')) |
810 if "\n" in user: | 810 if "\n" in user: |
811 raise error.Abort(_("username %s contains a newline\n") | 811 raise error.Abort(_("username %r contains a newline\n") |
812 % repr(user)) | 812 % pycompat.bytestr(user)) |
813 return user | 813 return user |
814 | 814 |
815 def shortuser(self, user): | 815 def shortuser(self, user): |
816 """Return a short representation of a user name or email address.""" | 816 """Return a short representation of a user name or email address.""" |
817 if not self.verbose: | 817 if not self.verbose: |