Patchwork [2,of,4] py3: fix type of default username

login
register
mail settings
Submitter Yuya Nishihara
Date March 6, 2018, 12:54 p.m.
Message ID <db161596cd95de9da2ac.1520340887@mimosa>
Download mbox | patch
Permalink /patch/29062/
State Accepted
Headers show

Comments

Yuya Nishihara - March 6, 2018, 12:54 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1520206486 18000
#      Sun Mar 04 18:34:46 2018 -0500
# Node ID db161596cd95de9da2ac0fc4b2496ac295f63672
# Parent  faea088aebdbda2e32e5339cbb6df51283fe2f56
py3: fix type of default username

Patch

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -48,6 +48,7 @@  test-command-template.t
 test-commit-amend.t
 test-commit-unresolved.t
 test-commit.t
+test-committer.t
 test-completion.t
 test-config-env.py
 test-config.t
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -800,7 +800,8 @@  class ui(object):
             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