diff mercurial/util.py @ 1343:0f4e53e8c66b

Add support for /etc/mercurial/hgrc.d/*.rc
author mpm@selenic.com
date Fri, 23 Sep 2005 19:35:23 -0700
parents 8f06817bf266
children 854775b27d1a
line wrap: on
line diff
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -426,8 +426,12 @@ if os.name == 'nt':
 else:
     nulldev = '/dev/null'
 
-    rcpath = map(os.path.normpath,
-                 ('/etc/mercurial/hgrc', os.path.expanduser('~/.hgrc')))
+    hgrcd = '/etc/mercurial/hgrc.d'
+    hgrcs = []
+    if os.path.isdir(hgrcd):
+        hgrcs = [f for f in os.listdir(hgrcd) if f.endswith(".rc")]
+    rcpath = map(os.path.normpath, hgrcs +
+                 ['/etc/mercurial/hgrc', os.path.expanduser('~/.hgrc')])
 
     def parse_patch_output(output_line):
         """parses the output produced by patch and returns the file name"""