D7679: windows: if username(uid=None) is loaded, just use getpass

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Tue Dec 17 03:51:41 EST 2019


Closed by commit rHG1b26cb044097: windows: if username(uid=None) is loaded, just use getpass (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7679?vs=18758&id=18799

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7679/new/

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

AFFECTED FILES
  mercurial/windows.py

CHANGE DETAILS

diff --git a/mercurial/windows.py b/mercurial/windows.py
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -8,6 +8,7 @@
 from __future__ import absolute_import
 
 import errno
+import getpass
 import msvcrt
 import os
 import re
@@ -563,6 +564,8 @@
     """Return the name of the user with the given uid.
 
     If uid is None, return the name of the current user."""
+    if not uid:
+        return pycompat.fsencode(getpass.getuser())
     return None
 
 



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


More information about the Mercurial-devel mailing list