Mercurial > hg
changeset 32964:6599b7372387
config: use the new '_unset' value for 'configdate'
This should let 'configdate' delegate all special processing of the default
config value to the main 'config' method.
The default value for date (None) is still enforced in this method if no other
default were passed.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 17 Jun 2017 12:54:45 +0200 |
parents | 88b3a38d39e3 |
children | 36e16797df32 |
files | mercurial/ui.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/ui.py Sat Jun 17 12:54:04 2017 +0200 +++ b/mercurial/ui.py Sat Jun 17 12:54:45 2017 +0200 @@ -649,7 +649,7 @@ return [] return v - def configdate(self, section, name, default=None, untrusted=False): + def configdate(self, section, name, default=_unset, untrusted=False): """parse a configuration element as a tuple of ints >>> u = ui(); s = 'foo' @@ -660,6 +660,8 @@ if self.config(section, name, default, untrusted): return self.configwith(util.parsedate, section, name, default, 'date', untrusted) + if default is _unset: + return None return default def hasconfig(self, section, name, untrusted=False):