comparison mercurial/util.py @ 2280:09ed44225571

On Windows look for mercurial.ini in $USERPROFILE, too, if available as os.path.expanduser('~') does not always yield a useful directory. Based on a patch from Edouard Gomez <ed.gomez@free.fr>
author Thomas Arendsen Hein <thomas@intevation.de>
date Sun, 14 May 2006 18:24:32 +0200
parents 3711e23ab10a
children d6392a7c03dd
comparison
equal deleted inserted replaced
2279:51bfa0fd3a33 2280:09ed44225571
533 except: 533 except:
534 return [r'c:\mercurial\mercurial.ini'] 534 return [r'c:\mercurial\mercurial.ini']
535 535
536 def os_rcpath(): 536 def os_rcpath():
537 '''return default os-specific hgrc search path''' 537 '''return default os-specific hgrc search path'''
538 return system_rcpath() + [os.path.join(os.path.expanduser('~'), 538 path = system_rcpath()
539 'mercurial.ini')] 539 path.append(os.path.join(os.path.expanduser('~'), 'mercurial.ini'))
540 userprofile = os.environ.get('USERPROFILE')
541 if userprofile:
542 path.append(os.path.join(userprofile, 'mercurial.ini'))
543 return path
540 544
541 def parse_patch_output(output_line): 545 def parse_patch_output(output_line):
542 """parses the output produced by patch and returns the file name""" 546 """parses the output produced by patch and returns the file name"""
543 pf = output_line[14:] 547 pf = output_line[14:]
544 if pf[0] == '`': 548 if pf[0] == '`':