mercurial/ui.py
changeset 32982 6599b7372387
parent 32981 88b3a38d39e3
child 32983 36e16797df32
equal deleted inserted replaced
32981:88b3a38d39e3 32982:6599b7372387
   647             return config.parselist(v)
   647             return config.parselist(v)
   648         elif v is None:
   648         elif v is None:
   649             return []
   649             return []
   650         return v
   650         return v
   651 
   651 
   652     def configdate(self, section, name, default=None, untrusted=False):
   652     def configdate(self, section, name, default=_unset, untrusted=False):
   653         """parse a configuration element as a tuple of ints
   653         """parse a configuration element as a tuple of ints
   654 
   654 
   655         >>> u = ui(); s = 'foo'
   655         >>> u = ui(); s = 'foo'
   656         >>> u.setconfig(s, 'date', '0 0')
   656         >>> u.setconfig(s, 'date', '0 0')
   657         >>> u.configdate(s, 'date')
   657         >>> u.configdate(s, 'date')
   658         (0, 0)
   658         (0, 0)
   659         """
   659         """
   660         if self.config(section, name, default, untrusted):
   660         if self.config(section, name, default, untrusted):
   661             return self.configwith(util.parsedate, section, name, default,
   661             return self.configwith(util.parsedate, section, name, default,
   662                                    'date', untrusted)
   662                                    'date', untrusted)
       
   663         if default is _unset:
       
   664             return None
   663         return default
   665         return default
   664 
   666 
   665     def hasconfig(self, section, name, untrusted=False):
   667     def hasconfig(self, section, name, untrusted=False):
   666         return self._data(untrusted).hasitem(section, name)
   668         return self._data(untrusted).hasitem(section, name)
   667 
   669