[PATCH 1 of 1] acl: more descriptive error messages

elifarley at gmail.com elifarley at gmail.com
Thu Oct 6 18:37:42 CDT 2011


 hgext/acl.py |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)


# HG changeset patch
# User Elifarley Callado Coelho Cruz
# Date 1317941126 10800
# Node ID fd2d2b3d811d8351a2eae34342a0b02eb3e0cba4
# Parent  6dc67dced8c122f6139ae20ccdc03a6b11e8b765
acl: more descriptive error messages

diff --git a/hgext/acl.py b/hgext/acl.py
--- a/hgext/acl.py
+++ b/hgext/acl.py
@@ -216,6 +216,8 @@
     if user is None:
         user = getpass.getuser()
 
+    ui.debug('acl: checking access for user "%s"\n' % user)
+
     cfg = ui.config('acl', 'config')
     if cfg:
         ui.readconfig(cfg, sections = ['acl.groups', 'acl.allow.branches',
@@ -242,9 +244,9 @@
 
         for f in ctx.files():
             if deny and deny(f):
-                ui.debug('acl: user %s denied on %s\n' % (user, f))
-                raise util.Abort(_('acl: access denied for changeset %s') % ctx)
+                raise util.Abort(_('acl: user "%s" denied on "%s"'
+                ' (changeset "%s")') % (user, f, ctx))
             if allow and not allow(f):
-                ui.debug('acl: user %s not allowed on %s\n' % (user, f))
-                raise util.Abort(_('acl: access denied for changeset %s') % ctx)
-        ui.debug('acl: allowing changeset %s\n' % ctx)
+                raise util.Abort(_('acl: user "%s" not allowed on "%s"'
+                ' (changeset "%s")') % (user, f, ctx))
+        ui.debug('acl: path access granted: "%s"\n' % ctx)


More information about the Mercurial-devel mailing list