py3: fix type of default username
authorYuya Nishihara <yuya@tcha.org>
Sun, 04 Mar 2018 18:34:46 -0500
changeset 36784 e3732c3ab92d
parent 36783 1fbbb8e83392
child 36785 e2c0c0884b1f
py3: fix type of default username
contrib/python3-whitelist
mercurial/ui.py
--- a/contrib/python3-whitelist	Sun Mar 04 18:21:16 2018 -0500
+++ b/contrib/python3-whitelist	Sun Mar 04 18:34:46 2018 -0500
@@ -48,6 +48,7 @@
 test-commit-amend.t
 test-commit-unresolved.t
 test-commit.t
+test-committer.t
 test-completion.t
 test-config-env.py
 test-config.t
--- a/mercurial/ui.py	Sun Mar 04 18:21:16 2018 -0500
+++ b/mercurial/ui.py	Sun Mar 04 18:34:46 2018 -0500
@@ -800,7 +800,8 @@
             user = self.prompt(_("enter a commit username:"), default=None)
         if user is None and not self.interactive():
             try:
-                user = '%s@%s' % (util.getuser(), socket.getfqdn())
+                user = '%s@%s' % (util.getuser(),
+                                  encoding.strtolocal(socket.getfqdn()))
                 self.warn(_("no username found, using '%s' instead\n") % user)
             except KeyError:
                 pass