# HG changeset patch # User Elifarley Callado Coelho Cruz # Date 1337359664 10800 # Node ID 9d778f80ad2a5418241c58df80732d51d8d655a7 # Parent 754e98e0a615257009deb95089e21e92c5bd5cf9 acl: perform some computations earlier, so that returned lambda functions are simpler diff -r 754e98e0a615 -r 9d778f80ad2a hgext/acl.py --- 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