acl: perform some computations earlier, so that returned lambda functions are simpler
--- a/hgext/acl.py Fri May 18 12:48:24 2012 -0300
+++ b/hgext/acl.py Fri May 18 13:47:44 2012 -0300
@@ -193,7 +193,11 @@
# Branch-based ACL
if not repo:
if pats:
- return lambda b: '*' in pats or b in pats
+ # If there's an asterisk (meaning "any branch"), always return True;
+ # Otherwise, test if b is in pats
+ if '*' in pats:
+ return util.always
+ return lambda b: b in pats
return util.never
# Path-based ACL