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

Elifarley Callado Coelho Cruz elifarley at gmail.com
Sun Apr 18 17:25:18 CDT 2010


Thanks for the tips, Matt!

I'm a long-time Java developer who's just starting to play with Python, so
it'll take some time for me to adapt ;)

Cheers,
Elifarley

On Sun, Apr 18, 2010 at 17:13, Matt Mackall <mpm at selenic.com> wrote:

> 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
>
>
>


-- 
Elifarley Cruz

Profile: http://bit.ly/9hrz0P
Professional info: http://br.linkedin.com/in/elifarley
Google Reader: http://bit.ly/2W7JK2
Bookmarks: http://delicious.com/elifarley
http://twitter.com/elifarley
http://elifarley.amplify.com/
-

" Do not believe anything because it is said by an authority, or if it  is
said to come from angels, or from Gods, or from an inspired source.
Believe it only if you have explored it in your own heart and mind and body
and found it to be true.  Work out your own path, through diligence."
- Gautama Buddha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100418/8a363877/attachment.htm>


More information about the Mercurial-devel mailing list