comparison mercurial/scmutil.py @ 16808:572d5e254f20

scmutil: use _winreg.HKEY_LOCAL_MACHINE
author Adrian Buehlmann <adrian@cadifra.com>
date Sun, 27 May 2012 11:30:03 +0200
parents 977c80123835
children 8abee656e14c
comparison
equal deleted inserted replaced
16807:80142f385af9 16808:572d5e254f20
463 else: 463 else:
464 return [os.path.expanduser('~/.hgrc')] 464 return [os.path.expanduser('~/.hgrc')]
465 465
466 else: 466 else:
467 467
468 _HKEY_LOCAL_MACHINE = 0x80000002L 468 import _winreg
469 469
470 def systemrcpath(): 470 def systemrcpath():
471 '''return default os-specific hgrc search path''' 471 '''return default os-specific hgrc search path'''
472 rcpath = [] 472 rcpath = []
473 filename = util.executablepath() 473 filename = util.executablepath()
483 if f.endswith('.rc'): 483 if f.endswith('.rc'):
484 rcpath.append(os.path.join(progrcd, f)) 484 rcpath.append(os.path.join(progrcd, f))
485 return rcpath 485 return rcpath
486 # else look for a system rcpath in the registry 486 # else look for a system rcpath in the registry
487 value = util.lookupreg('SOFTWARE\\Mercurial', None, 487 value = util.lookupreg('SOFTWARE\\Mercurial', None,
488 _HKEY_LOCAL_MACHINE) 488 _winreg.HKEY_LOCAL_MACHINE)
489 if not isinstance(value, str) or not value: 489 if not isinstance(value, str) or not value:
490 return rcpath 490 return rcpath
491 value = util.localpath(value) 491 value = util.localpath(value)
492 for p in value.split(os.pathsep): 492 for p in value.split(os.pathsep):
493 if p.lower().endswith('mercurial.ini'): 493 if p.lower().endswith('mercurial.ini'):