comparison mercurial/scmutil.py @ 23142:c4ce077588d0

config: introduce "built-in" default configuration settings in default.d This helps providing a more consistent user experience on all platforms and with all packaging. The exact location of default.d depends on how Mercurial is installed and whether it is 'frozen'. The exact location should never be relevant to users and is intentionally not explained in details in the documentation. It will however always be next to the help and templates files. Note that setting HGRCPATH also disables these defaults. I don't know if that should be considered a bug or a feature.
author Mads Kiilerich <madski@unity3d.com>
date Thu, 04 Sep 2014 21:36:35 +0200
parents 4d680deb0d9e
children 9f4778027bc2
comparison
equal deleted inserted replaced
23141:a440166d03fc 23142:c4ce077588d0
493 newdirs.append(d) 493 newdirs.append(d)
494 dirs[:] = newdirs 494 dirs[:] = newdirs
495 495
496 def osrcpath(): 496 def osrcpath():
497 '''return default os-specific hgrc search path''' 497 '''return default os-specific hgrc search path'''
498 path = systemrcpath() 498 path = []
499 defaultpath = os.path.join(util.datapath, 'default.d')
500 if os.path.isdir(defaultpath):
501 for f, kind in osutil.listdir(defaultpath):
502 if f.endswith('.rc'):
503 path.append(os.path.join(defaultpath, f))
504 path.extend(systemrcpath())
499 path.extend(userrcpath()) 505 path.extend(userrcpath())
500 path = [os.path.normpath(f) for f in path] 506 path = [os.path.normpath(f) for f in path]
501 return path 507 return path
502 508
503 _rcpath = None 509 _rcpath = None