post commit hook question

Martin Pool mbp at sourcefrog.net
Tue Nov 29 21:40:22 UTC 2011


On 30 November 2011 08:08, Stephen Auyeung <stephen at ck12.org> wrote:
> Thanks for the reply, Andrew.
>
> After loading the plugins, the post commit hook is working now. However, for
> some reason, if I added a new directory (could be the same for a file, just
> have not tried it) and then call workingTree.commit(), the directory
> disappear from the machine where I perform the commit but is committed to
> the remote repository.

I can't think of normally anything called from commit that would
delete a versioned directory.  Try disabling all the hooks, and see if
you can reproduce it.

> Before the post commit hook was working, I believe
> the directory was there. I also tried workingTree.branch.update() after the
> commit and still did not get it back; but manually "bzr update" worked. Any
> clue?

I think you would want just WorkingTree.update..


>
> FYI, the post commit hook was to run a remote command using pssh asking
> other bzr clients to perform a "bzr update".
>
> Thanks,
> Stephen
>
> -----Original Message-----
> From: Andrew Bennetts [mailto:andrew at bemusement.org]
> Sent: Monday, November 28, 2011 2:37 PM
> To: Stephen Au-Yeung
> Cc: bazaar at lists.canonical.com
> Subject: Re: post commit hook question
>
> On Mon, Nov 28, 2011 at 01:58:30PM -0800, Stephen Au-Yeung wrote:
>> Hi,
>>
>> I've installed a post commit hook that works when I do "bzr commit ...".
>> However, when I use the bzrlib's WorkingTree to commit, the hook was
>> not executed. What else do I need to do in order for this to work?
>
> Are you loading plugins in your code that calls bzrlib?
>
>    from bzrlib.plugin import load_plugins
>    load_plugins()
>
> -Andrew.
>
>
>



-- 
Martin



More information about the bazaar mailing list