comparison mercurial/util.py @ 2284:d6392a7c03dd

On win98 os.path.expanuser('~') does not result in a useable directory. The MSDN recommendation for user specific directories is the use of shell.ShGetSpecialFolder, so use it. For details see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shgetspecialfolderpath.asp
author Volker Kleinfeld <Volker.Kleinfeld@gmx.de>
date Sun, 14 May 2006 23:44:50 -0700
parents 09ed44225571
children cb520d961d6a
comparison
equal deleted inserted replaced
2283:e506c14382fd 2284:d6392a7c03dd
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 path = system_rcpath() 538 path = system_rcpath()
539 path.append(os.path.join(os.path.expanduser('~'), 'mercurial.ini')) 539 path.append(user_rcpath())
540 userprofile = os.environ.get('USERPROFILE') 540 userprofile = os.environ.get('USERPROFILE')
541 if userprofile: 541 if userprofile:
542 path.append(os.path.join(userprofile, 'mercurial.ini')) 542 path.append(os.path.join(userprofile, 'mercurial.ini'))
543 return path 543 return path
544
545 def user_rcpath():
546 '''return os-specific hgrc search path to the user dir'''
547 return os.path.join(os.path.expanduser('~'), 'mercurial.ini')
544 548
545 def parse_patch_output(output_line): 549 def parse_patch_output(output_line):
546 """parses the output produced by patch and returns the file name""" 550 """parses the output produced by patch and returns the file name"""
547 pf = output_line[14:] 551 pf = output_line[14:]
548 if pf[0] == '`': 552 if pf[0] == '`':