mercurial/ui.py
changeset 42672 51a2e3102db2
parent 42561 44e99811bea7
child 43076 2372284d9457
equal deleted inserted replaced
42671:e77be7e2109f 42672:51a2e3102db2
   780             return self.configwith(dateutil.parsedate, section, name, default,
   780             return self.configwith(dateutil.parsedate, section, name, default,
   781                                    'date', untrusted)
   781                                    'date', untrusted)
   782         if default is _unset:
   782         if default is _unset:
   783             return None
   783             return None
   784         return default
   784         return default
       
   785 
       
   786     def configdefault(self, section, name):
       
   787         """returns the default value of the config item"""
       
   788         item = self._knownconfig.get(section, {}).get(name)
       
   789         itemdefault = None
       
   790         if item is not None:
       
   791             if callable(item.default):
       
   792                 itemdefault = item.default()
       
   793             else:
       
   794                 itemdefault = item.default
       
   795         return itemdefault
   785 
   796 
   786     def hasconfig(self, section, name, untrusted=False):
   797     def hasconfig(self, section, name, untrusted=False):
   787         return self._data(untrusted).hasitem(section, name)
   798         return self._data(untrusted).hasitem(section, name)
   788 
   799 
   789     def has_section(self, section, untrusted=False):
   800     def has_section(self, section, untrusted=False):