monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] New commands (for mtn, in lua)


From: Matthew Sackman
Subject: Re: [Monotone-devel] New commands (for mtn, in lua)
Date: Mon, 3 Sep 2007 22:29:57 +0100
User-agent: Mutt/1.5.16 (2007-06-11)

Hi,

On Fri, Jul 06, 2007 at 10:17:22AM -0700, William Uther wrote:
> On 06/07/2007, at 9:00 AM, address@hidden wrote:
>> On Friday 06 July 2007, William Uther wrote:
>>>    mtn_automate(...) : This allows any of the automate commands to be
>>> called from lua.  The result is returned as a string.
>>
>> Seems like something one really wants to have.
>>
>> However, there is potential for deadlocks, when some command calls a Lua 
>> hook
>> that calls an automate command that calls a Lua hook...
>
> I didn't want lua hooks calling automate commands because I wasn't sure 
> what that would do, and I didn't
> think it was necessary.  So there is a flag in the code that only turns 
> mtn_automate on when it is being
> called from a user command.  It also turns the flag off inside mtn_automate 
> itself so you can't get
> recursion (you'll get an error if you try).

Agh. I'm still running 0.36, so do tell if this has been changed, but
looking at the code, it hasn't.

This is a major pain for me. I would like to be able to write hooks
that, eg on note_netsync_revision_received, take the revision and can
get hold of parents, or do diffs. This flag would seem to prevent me
from doing that.

Now at this point I don't mind if you want to prohibit any automate
command that can modify the mtn database and just want to allow pure
functions, that would suit me fine. But err, it would be great to get
this functionality to work.

Cheers,

Matthew
-- 
Matthew Sackman
http://www.wellquite.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]