[HELP!] serverside hooks behind bzr+http://

Marius Kruger amanic at gmail.com
Sat Sep 13 16:16:54 BST 2008


2008/9/12 Marius Kruger <amanic at gmail.com>

> Hi,
> I'm trying to get hooks called on the server when commits come in over
> bzr+http://
> I have tried a lot of things and got it working over bzr://
>
> I'm using this fcgi script:
> """
> #! /usr/bin/env python
>
> import fcgi
> from bzrlib.transport.http import wsgi
>
> smart_server_app = wsgi.make_app(
>     root='/var/lib/gforge/bzrroot',
>     prefix='/bzr/',
>     path_var='REQUEST_URI',
>     readonly=False)
>
> fcgi.WSGIServer(smart_server_app).run()
> """
>

After some debugging, I figured out the problem was that the plugins were
not loading.
it turns out the above fcgi script which comes from the docs
(http_smart_server.txt), DOES NOT LOAD PLUGINS!
And obviously for registering hooks you need to load the plugins.
Anyways, I added the following near the top of the script, and Bob was my
auntie (i.e. it worked):

from bzrlib.plugin import load_plugins
load_plugins()



I'll submit a patch to mention this in the docs at some stage.
Thanks a lot Viktor for trying to help me.

regards
marius
--
Its great to be a developer, its so much more challenging and rewarding than
being a gamer.
When you figure something out after struggling with it for a long time, its
quite an adrenaline rush.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20080913/b5b61827/attachment.htm 


More information about the bazaar mailing list