Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
1342:5a42da1db402 | 1343:0f4e53e8c66b |
---|---|
424 return "exited with status %d" % code, code | 424 return "exited with status %d" % code, code |
425 | 425 |
426 else: | 426 else: |
427 nulldev = '/dev/null' | 427 nulldev = '/dev/null' |
428 | 428 |
429 rcpath = map(os.path.normpath, | 429 hgrcd = '/etc/mercurial/hgrc.d' |
430 ('/etc/mercurial/hgrc', os.path.expanduser('~/.hgrc'))) | 430 hgrcs = [] |
431 if os.path.isdir(hgrcd): | |
432 hgrcs = [f for f in os.listdir(hgrcd) if f.endswith(".rc")] | |
433 rcpath = map(os.path.normpath, hgrcs + | |
434 ['/etc/mercurial/hgrc', os.path.expanduser('~/.hgrc')]) | |
431 | 435 |
432 def parse_patch_output(output_line): | 436 def parse_patch_output(output_line): |
433 """parses the output produced by patch and returns the file name""" | 437 """parses the output produced by patch and returns the file name""" |
434 return output_line[14:] | 438 return output_line[14:] |
435 | 439 |