Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
10387:9b87c5f4c634 | 10388:07bd7608a0ea |
---|---|
129 filename = win32api.GetModuleFileName(0) | 129 filename = win32api.GetModuleFileName(0) |
130 # Use mercurial.ini found in directory with hg.exe | 130 # Use mercurial.ini found in directory with hg.exe |
131 progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini') | 131 progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini') |
132 if os.path.isfile(progrc): | 132 if os.path.isfile(progrc): |
133 return [progrc] | 133 return [progrc] |
134 # Use hgrc.d found in directory with hg.exe | |
135 progrcd = os.path.join(os.path.dirname(filename), 'hgrc.d') | |
136 if os.path.isdir(progrcd): | |
137 rcpath = [] | |
138 for f, kind in osutil.listdir(progrcd): | |
139 if f.endswith('.rc'): | |
140 rcpath.append(os.path.join(progrcd, f)) | |
141 return rcpath | |
134 # else look for a system rcpath in the registry | 142 # else look for a system rcpath in the registry |
135 try: | 143 try: |
136 value = win32api.RegQueryValue( | 144 value = win32api.RegQueryValue( |
137 win32con.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Mercurial') | 145 win32con.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Mercurial') |
138 rcpath = [] | 146 rcpath = [] |