monotone-devel
[Top][All Lists]
Advanced

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

[Monotone-devel] Lua hooks


From: Wim Oudshoorn
Subject: [Monotone-devel] Lua hooks
Date: Mon, 12 Jun 2006 20:27:02 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/22.0.50 (darwin)

At work we have implemented a few lua hooks.  Most of the time
we just want to tweak the behaviour of the existent hooks. 
Now this seeem harder than needed.  
For example a colleague of mine has implemented a little
script that automates the merging of Changelog files.
In order to use the script you have to implement/change the  

   get_preferred_merge[2|3]_command

Lua function.  In simple terms, you want to implement it as follows:

 1 - if file name is "Changelog"  return our script
 2 - otherwise call the original get_preferred_merge...

Now the problem is with step 2.  How do you call the original implementation
without copying the definition from the monotone documentation?

Maybe this is very easy to achieve.  If not I would like to suggest to change
the implementation of the hooks like this:



function  'a monotone lua hook' (args)
   return 'a monotone lua hook'-default-implementation (args)
end


function 'a monotone lua-hook'-default-implementation (args)
-- the full implementation as provided by monotone.
end




This makes it a lot easier to just change the default hook slightly.

Wim Oudshoorn.





reply via email to

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