# HG changeset patch # User Pierre-Yves David # Date 1497696844 -7200 # Node ID 88b3a38d39e32d35530defe048b415420f77eba8 # Parent 0bf986cfa82bfd8e54d339146e0cebc4e9787dca config: use the new '_unset' value for 'configlist' This should let 'configlist' delegate all special processing of the default config value to the main 'config' method. The default config value ([]) is still handled in this method. diff -r 0bf986cfa82b -r 88b3a38d39e3 mercurial/ui.py --- a/mercurial/ui.py Sat Jun 17 12:53:51 2017 +0200 +++ b/mercurial/ui.py Sat Jun 17 12:54:04 2017 +0200 @@ -631,7 +631,7 @@ raise error.ConfigError(_("%s.%s is not a byte quantity ('%s')") % (section, name, value)) - def configlist(self, section, name, default=None, untrusted=False): + def configlist(self, section, name, default=_unset, untrusted=False): """parse a configuration element as a list of comma/space separated strings @@ -641,10 +641,13 @@ ['this', 'is', 'a small', 'test'] """ # default is not always a list - if isinstance(default, bytes): - default = config.parselist(default) - return self.configwith(config.parselist, section, name, default or [], + v = self.configwith(config.parselist, section, name, default, 'list', untrusted) + if isinstance(v, bytes): + return config.parselist(v) + elif v is None: + return [] + return v def configdate(self, section, name, default=None, untrusted=False): """parse a configuration element as a tuple of ints