Mercurial > hg
comparison mercurial/scmutil.py @ 14226:73cca883370d
rename scmutil.user_rcpath to userrcpath
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Fri, 06 May 2011 14:58:04 +0200 |
parents | f0ca440b5722 |
children | 94985b5a8278 |
comparison
equal
deleted
inserted
replaced
14225:f0ca440b5722 | 14226:73cca883370d |
---|---|
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 = systemrcpath() | 365 path = systemrcpath() |
366 path.extend(user_rcpath()) | 366 path.extend(userrcpath()) |
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 |
371 | 371 |
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')) |
415 path.extend(rcfiles('/etc/mercurial')) | 415 path.extend(rcfiles('/etc/mercurial')) |
416 return path | 416 return path |
417 | 417 |
418 def user_rcpath(): | 418 def userrcpath(): |
419 return [os.path.expanduser('~/.hgrc')] | 419 return [os.path.expanduser('~/.hgrc')] |
420 | 420 |
421 else: | 421 else: |
422 | 422 |
423 _HKEY_LOCAL_MACHINE = 0x80000002L | 423 _HKEY_LOCAL_MACHINE = 0x80000002L |
451 for f, kind in osutil.listdir(p): | 451 for f, kind in osutil.listdir(p): |
452 if f.endswith('.rc'): | 452 if f.endswith('.rc'): |
453 rcpath.append(os.path.join(p, f)) | 453 rcpath.append(os.path.join(p, f)) |
454 return rcpath | 454 return rcpath |
455 | 455 |
456 def user_rcpath(): | 456 def userrcpath(): |
457 '''return os-specific hgrc search path to the user dir''' | 457 '''return os-specific hgrc search path to the user dir''' |
458 home = os.path.expanduser('~') | 458 home = os.path.expanduser('~') |
459 path = [os.path.join(home, 'mercurial.ini'), | 459 path = [os.path.join(home, 'mercurial.ini'), |
460 os.path.join(home, '.hgrc')] | 460 os.path.join(home, '.hgrc')] |
461 userprofile = os.environ.get('USERPROFILE') | 461 userprofile = os.environ.get('USERPROFILE') |