comparison mercurial/ui.py @ 14923:351624f8f523

ui: providing no default value to configpath should not raise an Error
author Simon Heimberg <simohe@besonet.ch>
date Sat, 23 Jul 2011 06:08:52 +0200
parents 1bc970a77977
children 545e00279670
comparison
equal deleted inserted replaced
14922:1bc970a77977 14923:351624f8f523
164 return value 164 return value
165 165
166 def configpath(self, section, name, default=None, untrusted=False): 166 def configpath(self, section, name, default=None, untrusted=False):
167 'get a path config item, expanded relative to config file' 167 'get a path config item, expanded relative to config file'
168 v = self.config(section, name, default, untrusted) 168 v = self.config(section, name, default, untrusted)
169 if v is None:
170 return None
169 if not os.path.isabs(v) or "://" not in v: 171 if not os.path.isabs(v) or "://" not in v:
170 src = self.configsource(section, name, untrusted) 172 src = self.configsource(section, name, untrusted)
171 if ':' in src: 173 if ':' in src:
172 base = os.path.dirname(src.rsplit(':')[0]) 174 base = os.path.dirname(src.rsplit(':')[0])
173 v = os.path.join(base, os.path.expanduser(v)) 175 v = os.path.join(base, os.path.expanduser(v))