[PATCH 2 of 3] various extensions: use ui.configpath() to get config file paths

Greg Ward greg-hg at gerg.ca
Thu Dec 1 02:41:29 UTC 2011


# HG changeset patch
# User Greg Ward <greg at gerg.ca>
# Date 1319423148 14400
# Node ID d7dfdb703334d49525d66fb2addad45e05462c4b
# Parent  9f8b6ff50a93a0b5d19bf1fd54c6f50794482d21
various extensions: use ui.configpath() to get config file paths

- acl: explain why we're not using configpath() (yet)
- bugzilla: usermap file
- notify: config file

diff --git a/hgext/acl.py b/hgext/acl.py
--- a/hgext/acl.py
+++ b/hgext/acl.py
@@ -218,6 +218,8 @@
 
     ui.debug('acl: checking access for user "%s"\n' % user)
 
+    # XXX should use ui.configpath() here, but the test seems to
+    # assume that acl.config is relative to the current dir
     cfg = ui.config('acl', 'config')
     if cfg:
         ui.readconfig(cfg, sections = ['acl.groups', 'acl.allow.branches',
diff --git a/hgext/bugzilla.py b/hgext/bugzilla.py
--- a/hgext/bugzilla.py
+++ b/hgext/bugzilla.py
@@ -262,7 +262,7 @@
 
     def __init__(self, ui):
         self.ui = ui
-        usermap = self.ui.config('bugzilla', 'usermap')
+        usermap = self.ui.configpath('bugzilla', 'usermap')
         if usermap:
             self.ui.readconfig(usermap, sections=['usermap'])
 
diff --git a/hgext/notify.py b/hgext/notify.py
--- a/hgext/notify.py
+++ b/hgext/notify.py
@@ -152,7 +152,7 @@
 
     def __init__(self, ui, repo, hooktype):
         self.ui = ui
-        cfg = self.ui.config('notify', 'config')
+        cfg = self.ui.configpath('notify', 'config')
         if cfg:
             self.ui.readconfig(cfg, sections=['usersubs', 'reposubs'])
         self.repo = repo


More information about the Mercurial-devel mailing list