Patchwork D2261: py3: use pycompat.bytestr to convert str to bytes

login
register
mail settings
Submitter phabricator
Date Feb. 15, 2018, 12:40 p.m.
Message ID <106ea8ccb0184bff3ae9d809685b9b0d@localhost.localdomain>
Download mbox | patch
Permalink /patch/27964/
State Not Applicable
Headers show

Comments

phabricator - Feb. 15, 2018, 12:40 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGddeb7653b31c: py3: use pycompat.bytestr to convert str to bytes (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2261?vs=5726&id=5757

REVISION DETAIL
  https://phab.mercurial-scm.org/D2261

AFFECTED FILES
  mercurial/changelog.py
  mercurial/ui.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -808,8 +808,8 @@ 
                              hint=_("use 'hg config --edit' "
                                     'to set your username'))
         if "\n" in user:
-            raise error.Abort(_("username %s contains a newline\n")
-                              % repr(user))
+            raise error.Abort(_("username %r contains a newline\n")
+                              % pycompat.bytestr(user))
         return user
 
     def shortuser(self, user):
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,
 )
@@ -517,8 +518,8 @@ 
         if not user:
             raise error.RevlogError(_("empty username"))
         if "\n" in user:
-            raise error.RevlogError(_("username %s contains a newline")
-                                    % repr(user))
+            raise error.RevlogError(_("username %r contains a newline")
+                                    % pycompat.bytestr(user))
 
         desc = stripdesc(desc)