Mercurial > hg
comparison mercurial/scmutil.py @ 14527:5867bd6e7cf5
scmutil: improve path calculation for install-relative RC files (issue2841)
This code was ugly and might do the wrong thing with symlinks.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 03 Jun 2011 15:08:08 -0500 |
parents | 4582a4dd1817 |
children | 2d2604adfdd6 |
comparison
equal
deleted
inserted
replaced
14526:4276e3202585 | 14527:5867bd6e7cf5 |
---|---|
412 | 412 |
413 def systemrcpath(): | 413 def systemrcpath(): |
414 path = [] | 414 path = [] |
415 # old mod_python does not set sys.argv | 415 # old mod_python does not set sys.argv |
416 if len(getattr(sys, 'argv', [])) > 0: | 416 if len(getattr(sys, 'argv', [])) > 0: |
417 path.extend(rcfiles(os.path.dirname(sys.argv[0]) + | 417 p = os.path.dirname(os.path.dirname(sys.argv[0])) |
418 '/../etc/mercurial')) | 418 path.extend(rcfiles(os.path.join(p, 'etc/mercurial'))) |
419 path.extend(rcfiles('/etc/mercurial')) | 419 path.extend(rcfiles('/etc/mercurial')) |
420 return path | 420 return path |
421 | 421 |
422 def userrcpath(): | 422 def userrcpath(): |
423 return [os.path.expanduser('~/.hgrc')] | 423 return [os.path.expanduser('~/.hgrc')] |