# HG changeset patch # User Thomas Arendsen Hein # Date 1147623872 -7200 # Node ID 09ed44225571cf4fc05fac6388198542c03086c7 # Parent 51bfa0fd3a33c240e235bbdcab7e353b0c64f94a On Windows look for mercurial.ini in $USERPROFILE, too, if available as os.path.expanduser('~') does not always yield a useful directory. Based on a patch from Edouard Gomez diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -535,8 +535,12 @@ if os.name == 'nt': def os_rcpath(): '''return default os-specific hgrc search path''' - return system_rcpath() + [os.path.join(os.path.expanduser('~'), - 'mercurial.ini')] + path = system_rcpath() + path.append(os.path.join(os.path.expanduser('~'), 'mercurial.ini')) + userprofile = os.environ.get('USERPROFILE') + if userprofile: + path.append(os.path.join(userprofile, 'mercurial.ini')) + return path def parse_patch_output(output_line): """parses the output produced by patch and returns the file name"""