--- a/hgext/acl.py Mon May 10 21:15:12 2010 +0200
+++ b/hgext/acl.py Mon May 10 21:44:00 2010 +0200
@@ -161,7 +161,10 @@
ui.debug('acl: "%s" not defined in [acl.groups]\n' % group)
# If no users found in group definition, get users from OS-level group
- return util.groupmembers(group)
+ try:
+ return util.groupmembers(group)
+ except KeyError:
+ raise util.Abort(_("group '%s' is undefined") % group)
def _usermatch(ui, user, usersorgroups):
--- a/tests/test-acl Mon May 10 21:15:12 2010 +0200
+++ b/tests/test-acl Mon May 10 21:44:00 2010 +0200
@@ -165,4 +165,12 @@
echo "@group is allowed inside anything but foo/Bar/"
do_push fred
+echo 'Invalid group'
+# Disable the fakegroups trick to get real failures
+grep -v fakegroups $config > config.tmp
+mv config.tmp $config
+echo '[acl.allow]' >> $config
+echo "** = @unlikelytoexist" >> $config
+do_push fred 2>&1 | grep unlikelytoexist
+true
--- a/tests/test-acl.out Mon May 10 21:15:12 2010 +0200
+++ b/tests/test-acl.out Mon May 10 21:44:00 2010 +0200
@@ -1557,3 +1557,8 @@
no rollback information available
0:6675d58eff77
+Invalid group
+** = @unlikelytoexist
+acl: "unlikelytoexist" not defined in [acl.groups]
+error: pretxnchangegroup.acl hook failed: group 'unlikelytoexist' is undefined
+abort: group 'unlikelytoexist' is undefined