comparison mercurial/scmutil.py @ 14225:f0ca440b5722

rename scmutil.system_rcpath to systemrcpath
author Adrian Buehlmann <adrian@cadifra.com>
date Fri, 06 May 2011 14:54:05 +0200
parents f4189866c76c
children 73cca883370d
comparison
equal deleted inserted replaced
14224:f4189866c76c 14225:f0ca440b5722
360 newdirs.append(d) 360 newdirs.append(d)
361 dirs[:] = newdirs 361 dirs[:] = newdirs
362 362
363 def osrcpath(): 363 def osrcpath():
364 '''return default os-specific hgrc search path''' 364 '''return default os-specific hgrc search path'''
365 path = system_rcpath() 365 path = systemrcpath()
366 path.extend(user_rcpath()) 366 path.extend(user_rcpath())
367 path = [os.path.normpath(f) for f in path] 367 path = [os.path.normpath(f) for f in path]
368 return path 368 return path
369 369
370 _rcpath = None 370 _rcpath = None
404 if f.endswith(".rc")]) 404 if f.endswith(".rc")])
405 except OSError: 405 except OSError:
406 pass 406 pass
407 return rcs 407 return rcs
408 408
409 def system_rcpath(): 409 def systemrcpath():
410 path = [] 410 path = []
411 # old mod_python does not set sys.argv 411 # old mod_python does not set sys.argv
412 if len(getattr(sys, 'argv', [])) > 0: 412 if len(getattr(sys, 'argv', [])) > 0:
413 path.extend(rcfiles(os.path.dirname(sys.argv[0]) + 413 path.extend(rcfiles(os.path.dirname(sys.argv[0]) +
414 '/../etc/mercurial')) 414 '/../etc/mercurial'))
420 420
421 else: 421 else:
422 422
423 _HKEY_LOCAL_MACHINE = 0x80000002L 423 _HKEY_LOCAL_MACHINE = 0x80000002L
424 424
425 def system_rcpath(): 425 def systemrcpath():
426 '''return default os-specific hgrc search path''' 426 '''return default os-specific hgrc search path'''
427 rcpath = [] 427 rcpath = []
428 filename = util.executable_path() 428 filename = util.executable_path()
429 # Use mercurial.ini found in directory with hg.exe 429 # Use mercurial.ini found in directory with hg.exe
430 progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini') 430 progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini')