# HG changeset patch # User Alexis S. L. Carvalho # Date 1161115466 10800 # Node ID f29989e9746ebf5a1fd8f01580d0875fc1ae9386 # Parent e4452c3fa7360f0060d33f0893d7937b4708e096 use ui.readsections in the acl extension diff --git a/hgext/acl.py b/hgext/acl.py --- a/hgext/acl.py +++ b/hgext/acl.py @@ -80,7 +80,7 @@ class checker(object): self.user = getpass.getuser() cfg = self.ui.config('acl', 'config') if cfg: - self.ui.readconfig(cfg) + self.ui.readsections(cfg, 'acl.allow', 'acl.deny') self.allow, self.allowable = self.buildmatch('acl.allow') self.deny, self.deniable = self.buildmatch('acl.deny') diff --git a/tests/test-acl b/tests/test-acl --- a/tests/test-acl +++ b/tests/test-acl @@ -102,3 +102,8 @@ echo '[acl.allow]' >> acl.config echo 'foo/** = betty' >> acl.config do_push betty +echo 'acl.config can set only [acl.allow]/[acl.deny]' +echo '[hooks]' >> acl.config +echo 'changegroup.acl = false' >> acl.config +do_push barney + diff --git a/tests/test-acl.out b/tests/test-acl.out --- a/tests/test-acl.out +++ b/tests/test-acl.out @@ -469,3 +469,49 @@ rollback completed no rollback information available 0:6675d58eff77 +acl.config can set only [acl.allow]/[acl.deny] +Pushing as user barney +hgrc = """ +[hooks] +pretxnchangegroup.acl = python:hgext.acl.hook +[acl] +sources = push +[acl.allow] +foo/** = fred +[acl.deny] +foo/bar/** = fred +foo/Bar/** = fred +[acl.allow] +** = barney +**/*.txt = wilma +[acl] +config = ../acl.config +""" +acl.config = """ +[acl.allow] +foo/** = betty +[hooks] +changegroup.acl = false +""" +pushing to ../b +searching for changes +common changesets up to 6675d58eff77 +adding changesets +add changeset ef1ea85a6374 +add changeset f9cafe1212c8 +add changeset 911600dab2ae +adding manifests +adding file changes +adding foo/Bar/file.txt revisions +adding foo/file.txt revisions +adding quux/file.py revisions +added 3 changesets with 3 changes to 3 files +calling hook pretxnchangegroup.acl: hgext.acl.hook +acl: acl.allow enabled, 1 entries for user barney +acl: acl.deny enabled, 0 entries for user barney +acl: allowing changeset ef1ea85a6374 +acl: allowing changeset f9cafe1212c8 +acl: allowing changeset 911600dab2ae +rolling back last transaction +0:6675d58eff77 +