mercurial/ui.py
changeset 31685 d83e51654c8a
parent 31683 00e569a2da97
child 31687 5bea95a1d353
equal deleted inserted replaced
31684:0be96ac9199a 31685:d83e51654c8a
   209 
   209 
   210     @classmethod
   210     @classmethod
   211     def load(cls):
   211     def load(cls):
   212         """Create a ui and load global and user configs"""
   212         """Create a ui and load global and user configs"""
   213         u = cls()
   213         u = cls()
   214         # we always trust global config files
   214         # we always trust global config files and environment variables
   215         for t, f in rcutil.rccomponents():
   215         for t, f in rcutil.rccomponents():
   216             if t == 'path':
   216             if t == 'path':
   217                 u.readconfig(f, trust=True)
   217                 u.readconfig(f, trust=True)
       
   218             elif t == 'items':
       
   219                 sections = set()
       
   220                 for section, name, value, source in f:
       
   221                     # do not set u._ocfg
       
   222                     # XXX clean this up once immutable config object is a thing
       
   223                     u._tcfg.set(section, name, value, source)
       
   224                     u._ucfg.set(section, name, value, source)
       
   225                     sections.add(section)
       
   226                 for section in sections:
       
   227                     u.fixconfig(section=section)
   218             else:
   228             else:
   219                 raise error.ProgrammingError('unknown rctype: %s' % t)
   229                 raise error.ProgrammingError('unknown rctype: %s' % t)
   220         return u
   230         return u
   221 
   231 
   222     def copy(self):
   232     def copy(self):