diff mercurial/ui.py @ 11225:d6dbd5e4ee72

ui.username(): expand environment variables in username configuration value. note: expansion of config variables must be handled on a case-by-case basis because they can contain arbitrary data that may not be desirable to expand.
author Chad Dombrova <chadrik@gmail.com>
date Wed, 26 May 2010 14:03:29 -0700
parents 4efdccaca21d
children e1dde7363601
line wrap: on
line diff
--- a/mercurial/ui.py	Wed May 26 14:03:29 2010 -0700
+++ b/mercurial/ui.py	Wed May 26 14:03:29 2010 -0700
@@ -266,6 +266,8 @@
         user = os.environ.get("HGUSER")
         if user is None:
             user = self.config("ui", "username")
+            if user is not None:
+                user = os.path.expandvars(user)
         if user is None:
             user = os.environ.get("EMAIL")
         if user is None and self.configbool("ui", "askusername"):