changeset 43904:1b26cb044097

windows: if username(uid=None) is loaded, just use getpass This is at least consistent with what we do on other platforms in the base case. I don't know enough about Windows to fill in other cases that might exist here, but this at least should be a start. Differential Revision: https://phab.mercurial-scm.org/D7679
author Augie Fackler <augie@google.com>
date Mon, 16 Dec 2019 17:10:51 -0500
parents d50b4ad1d4a5
children 4d59cc8bda65
files mercurial/windows.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/windows.py	Fri Dec 13 14:12:14 2019 -0800
+++ b/mercurial/windows.py	Mon Dec 16 17:10:51 2019 -0500
@@ -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