diff mercurial/util.py @ 6153:09a8be3e5bfb

Also search for .hgrc if mercurial.ini not found on windows
author Stefan Rank <strank(AT)strank(DOT)info>
date Wed, 20 Feb 2008 21:31:42 +0100
parents 47e6d5d5913a
children f857eac30cd5
line wrap: on
line diff
--- a/mercurial/util.py	Thu Feb 21 15:00:25 2008 +0100
+++ b/mercurial/util.py	Wed Feb 20 21:31:42 2008 +0100
@@ -968,13 +968,15 @@
     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):