[PATCH - ACL Extension] Added support for 'pretxncommit'.

Matt Mackall mpm at selenic.com
Sun Apr 18 15:13:03 CDT 2010


On Tue, 2010-04-06 at 22:47 -0300, Elifarley Callado Coelho Cruz wrote:
> With this patch, one can call the ACL hook at pre-commit time too.
> 
> This is useful because now we can avoid violating ACL permissions much
> sooner, at commit time, instead of waiting for a PUSH to check if
> there were any invalid commits.
> 
> --
> 
> # HG changeset patch
> # User Elifarley Callado Coelho Cruz <elifarley at gmail.com>
> # Date 1270602943 10800
> # Node ID 15c35780ef7bb48accf34d7cc627c6a2c3834a1d
> # Parent  f97b98db6fd1de6c60c1b60254c9240337dadc01
> Added support for 'pretxncommit', so that one can call the ACL hook at
> pre-commit time too. This is useful because now it's possible to avoid
> violating ACL permissions much sooner, at commit time, instead of
> waiting for a PUSH to check if there were any invalid commits.

Queued. This patch had whitespace damage, please fix that in the future
(you might find patchbomb helpful).

> +    if 'pretxnchangegroup' == hooktype and source not in
> ui.config('acl', 'sources', 'serve').split():

I fixed this long line and switched <constant> == <variable> back to the
more legible <variable> == <constant> form. There's no need for the
former style in Python as it's not possible to do assignments in
expressions in Python. It's also discouraged in a lot of C communities
due to reading difficulty and the fact that lots of compilers (including
GCC) will warn you about assignments in expressions anyway.

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial-devel mailing list