diff mercurial/win32.py @ 10388:07bd7608a0ea

win32: allow hgrc.d on Windows
author Steve Borho <steve@borho.org>
date Sun, 07 Feb 2010 05:34:22 -0600
parents d6512b3e9ac0
children 81631f0cf13b
line wrap: on
line diff
--- a/mercurial/win32.py	Mon Feb 08 00:01:08 2010 +0100
+++ b/mercurial/win32.py	Sun Feb 07 05:34:22 2010 -0600
@@ -131,6 +131,14 @@
     progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini')
     if os.path.isfile(progrc):
         return [progrc]
+    # Use hgrc.d found in directory with hg.exe
+    progrcd = os.path.join(os.path.dirname(filename), 'hgrc.d')
+    if os.path.isdir(progrcd):
+        rcpath = []
+        for f, kind in osutil.listdir(progrcd):
+            if f.endswith('.rc'):
+                rcpath.append(os.path.join(progrcd, f))
+        return rcpath
     # else look for a system rcpath in the registry
     try:
         value = win32api.RegQueryValue(