[MERGE][RFC] Enhanced hooks
Ian Clatworthy
ian.clatworthy at internode.on.net
Mon Feb 4 13:57:13 GMT 2008
This is part 3 of the enhanced hooks changes - the interesting bit. To
be fully functional, it require the previous 2 parts though this can be
reviewed separately and all tests should pass. (The obvious link points
to the 2 routines provided by the other patches are marked with comments.)
Here are the major points:
1. Scripts to run when hooks are triggered can now be defined in
configuration files. Multiple scripts can be given for each
hook and each hook is named.
2. By reusing our (nice) configuration architecture, we provide
a lot of flexibility. Some hooks may only be triggered for
a given branch, or for all users of a branch, or for all
branches. (Right now, that flexibility only applies to
shell hooks, though supporting triggering of Python hooks
is almost complete as well - see below.)
3. Arguments passed to a Python hook can be mapped to the most
appropriate "form" for a command line script - parameter,
stdin or an env variable. Likewise, outputs from the
command line script can be mapped back to Python results
as required. The way that mapping is done defines the
"shell script signature" for a given hook type.
As that signature is a "public interface", I'm marking this
patch as RFC. For the branch hooks, I've gone with what Jelmer did in
his shell-hook plugin (as I said I would). If anyone thinks we should do
something different, now's the time to speak up. :-)
In summary, this feature brings us up to (and arguably beyond) the hook
functionality delivered by Subversion, Git and Hg. Once merged, it will
make it much easier for non Python developers to integrate Bazaar into
their environments.
Ian C.
PS: Is there a nice method for turning a string like
'bzrlib.plugins.mystuff.myhook' into a (loaded) function object?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: enhanced-hooks.patch
Type: text/x-patch
Size: 27487 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080204/ae57150b/attachment-0001.bin
More information about the bazaar
mailing list