--- a/mercurial/ui.py Wed Dec 29 18:29:15 2010 -0800
+++ b/mercurial/ui.py Thu Jan 06 17:04:33 2011 -0600
@@ -153,6 +153,16 @@
"%s.%s = %s\n") % (section, name, uvalue))
return value
+ def configpath(self, section, name, default=None, untrusted=False):
+ 'get a path config item, expanded relative to config file'
+ v = self.config(section, name, default, untrusted)
+ if not os.path.isabs(v) or "://" not in v:
+ src = self.configsource(section, name, untrusted)
+ if ':' in src:
+ base = os.path.dirname(src.rsplit(':'))
+ v = os.path.join(base, os.path.expanduser(v))
+ return v
+
def configbool(self, section, name, default=False, untrusted=False):
v = self.config(section, name, None, untrusted)
if v is None: