# HG changeset patch # User Stefan Rank # Date 2008-02-20 20:31:42 # Node ID 09a8be3e5bfb5af13b7dc02abb5b8353957e96ac # Parent c050548307a40be0d8787f71082c52159c1a8c97 Also search for .hgrc if mercurial.ini not found on windows diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -968,13 +968,15 @@ if os.name == 'nt': def user_rcpath(): '''return os-specific hgrc search path to the user dir''' try: - userrc = user_rcpath_win32() + path = user_rcpath_win32() except: - userrc = os.path.join(os.path.expanduser('~'), 'mercurial.ini') - path = [userrc] + home = os.path.expanduser('~') + path = [os.path.join(home, 'mercurial.ini'), + os.path.join(home, '.hgrc')] userprofile = os.environ.get('USERPROFILE') if userprofile: path.append(os.path.join(userprofile, 'mercurial.ini')) + path.append(os.path.join(userprofile, '.hgrc')) return path def parse_patch_output(output_line): diff --git a/mercurial/util_win32.py b/mercurial/util_win32.py --- a/mercurial/util_win32.py +++ b/mercurial/util_win32.py @@ -255,7 +255,8 @@ def user_rcpath_win32(): appdir = shell.SHGetPathFromIDList( shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_APPDATA)) userdir = os.path.dirname(appdir) - return os.path.join(userdir, 'mercurial.ini') + return [os.path.join(userdir, 'mercurial.ini'), + os.path.join(userdir, '.hgrc')] class posixfile_nt(object): '''file object with posix-like semantics. on windows, normal