comparison mercurial/scmutil.py @ 16436:e98460f6089d

scmutil: fix systemrcpath regression introduced in f5dd179bfa4a Changeset f5dd179bfa4a introduced a 'root' path component to look for hgrc files, which is used both as an absolute path and a path relative to the <install-root>. The latter one was broken since 'root' was set to an absolute location and the subsequent os.path.join discarded the <install-root> path prefix.
author Wolfgang Treutterer <Wolfgang.Treutterer@ipp.mpg.de>
date Fri, 13 Apr 2012 10:08:08 +0200
parents 4df76d5506a9
children 154219f3a6a4
comparison
equal deleted inserted replaced
16435:df347129305d 16436:e98460f6089d
435 return rcs 435 return rcs
436 436
437 def systemrcpath(): 437 def systemrcpath():
438 path = [] 438 path = []
439 if sys.platform == 'plan9': 439 if sys.platform == 'plan9':
440 root = '/lib/mercurial' 440 root = 'lib/mercurial'
441 else: 441 else:
442 root = '/etc/mercurial' 442 root = 'etc/mercurial'
443 # old mod_python does not set sys.argv 443 # old mod_python does not set sys.argv
444 if len(getattr(sys, 'argv', [])) > 0: 444 if len(getattr(sys, 'argv', [])) > 0:
445 p = os.path.dirname(os.path.dirname(sys.argv[0])) 445 p = os.path.dirname(os.path.dirname(sys.argv[0]))
446 path.extend(rcfiles(os.path.join(p, root))) 446 path.extend(rcfiles(os.path.join(p, root)))
447 path.extend(rcfiles(root)) 447 path.extend(rcfiles('/' + root))
448 return path 448 return path
449 449
450 def userrcpath(): 450 def userrcpath():
451 if sys.platform == 'plan9': 451 if sys.platform == 'plan9':
452 return [os.environ['home'] + '/lib/hgrc'] 452 return [os.environ['home'] + '/lib/hgrc']