From 039ae01cfaadf6a70df3e5d013523e3f89ba4f76 Mon Sep 17 00:00:00 2001 From: Thomas Keller Date: Sat, 30 Oct 2010 22:09:55 +0000 Subject: [PATCH] Use an even smarter way of including additional resources for monotone by using a wildcard dir matcher and document this accordingly. --- doc/syncmonotone.mdtext | 8 ++++---- src/IDF/Plugin/SyncMonotone/monotonerc-auth.tpl | 13 +++++++++++-- src/IDF/Plugin/SyncMonotone/monotonerc-noauth.tpl | 12 ++++++++++-- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/doc/syncmonotone.mdtext b/doc/syncmonotone.mdtext index 7ca1d11..dd7629b 100644 --- a/doc/syncmonotone.mdtext +++ b/doc/syncmonotone.mdtext @@ -199,7 +199,7 @@ somewhere else for backup purposes. The monotone source tree already comes with [many example scripts and hooks](http://code.monotone.ca/p/monotone/source/tree/h:net.venge.monotone/contrib) which serve these purposes, after only little additional configuration. -The usher/indefero-controlled setup automatically looks for a file called -`hooks.lua` in the project's base directory (configured via $cfg['mtn_repositories']) -and this is the ideal place to put or link these additional lua sources. - +The usher/indefero-controlled setup automatically looks for *.lua files +in a directory called `hooks.d` right under the project's base directory +(configured via $cfg['mtn_repositories']) and this is the ideal place to +put or link these additional lua sources. diff --git a/src/IDF/Plugin/SyncMonotone/monotonerc-auth.tpl b/src/IDF/Plugin/SyncMonotone/monotonerc-auth.tpl index 7e5ff8c..c59d58f 100644 --- a/src/IDF/Plugin/SyncMonotone/monotonerc-auth.tpl +++ b/src/IDF/Plugin/SyncMonotone/monotonerc-auth.tpl @@ -65,6 +65,15 @@ push_hook_functions({ }) -- --- Load additional local hooks, in case they exist +-- Load local hooks if they exist. -- -include(get_confdir() .. "/hooks.lua") +-- The way this is supposed to work is that hooks.d can contain symbolic +-- links to lua scripts. These links MUST have the extension .lua +-- If the script needs some configuration, a corresponding file with +-- the extension .conf is the right spot. +-- +-- First load the configuration of the hooks, if applicable +includedirpattern(get_confdir() .. "/hooks.d/", "*.conf") +-- Then load the hooks themselves +includedirpattern(get_confdir() .. "/hooks.d/", "*.lua") + diff --git a/src/IDF/Plugin/SyncMonotone/monotonerc-noauth.tpl b/src/IDF/Plugin/SyncMonotone/monotonerc-noauth.tpl index e59aa04..3ad79ba 100644 --- a/src/IDF/Plugin/SyncMonotone/monotonerc-noauth.tpl +++ b/src/IDF/Plugin/SyncMonotone/monotonerc-noauth.tpl @@ -79,6 +79,14 @@ push_hook_functions({ }) -- --- Load additional local hooks, in case they exist +-- Load local hooks if they exist. -- -include(get_confdir() .. "/hooks.lua") +-- The way this is supposed to work is that hooks.d can contain symbolic +-- links to lua scripts. These links MUST have the extension .lua +-- If the script needs some configuration, a corresponding file with +-- the extension .conf is the right spot. +-- +-- First load the configuration of the hooks, if applicable +includedirpattern(get_confdir() .. "/hooks.d/", "*.conf") +-- Then load the hooks themselves +includedirpattern(get_confdir() .. "/hooks.d/", "*.lua")