comparison mercurial/util.py @ 1635:ae61937c61c5

Fix rcpath for hgwebdir case (sys.argv is empty)
author efiring@manini.soest.hawaii.edu
date Tue, 24 Jan 2006 13:59:11 +1300
parents 301d5cd4abc6
children 7596611ab3d5 b0f6af327fd4 e4abeafd6eb1
comparison
equal deleted inserted replaced
1634:f49f602fae92 1635:ae61937c61c5
542 try: 542 try:
543 rcs.extend([os.path.join(rcdir, f) for f in os.listdir(rcdir) 543 rcs.extend([os.path.join(rcdir, f) for f in os.listdir(rcdir)
544 if f.endswith(".rc")]) 544 if f.endswith(".rc")])
545 except OSError, inst: pass 545 except OSError, inst: pass
546 return rcs 546 return rcs
547 rcpath = rcfiles(os.path.dirname(sys.argv[0]) + '/../etc/mercurial') 547 rcpath = []
548 if len(sys.argv) > 0:
549 rcpath.extend(rcfiles(os.path.dirname(sys.argv[0]) + '/../etc/mercurial'))
548 rcpath.extend(rcfiles('/etc/mercurial')) 550 rcpath.extend(rcfiles('/etc/mercurial'))
549 rcpath.append(os.path.expanduser('~/.hgrc')) 551 rcpath.append(os.path.expanduser('~/.hgrc'))
550 rcpath = [os.path.normpath(f) for f in rcpath] 552 rcpath = [os.path.normpath(f) for f in rcpath]
551 553
552 def parse_patch_output(output_line): 554 def parse_patch_output(output_line):