]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/bugs/Monotone_rcs_support.mdwn
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
[git.ikiwiki.info.git] / doc / bugs / Monotone_rcs_support.mdwn
1 The Monotone module still lacks support for setting up a post-commit hook,
2 so commits made via monotone will not automatically update the wiki.
4 Here for future reference is the most recent version of support for 
5 that I've been sent. It's not yet working; there are path issues. --[[Joey]]
7 <pre>
8 diff --git a/IkiWiki/Rcs/monotone.pm b/IkiWiki/Rcs/monotone.pm
9 index cde6029..34f8f96 100644
10 --- a/IkiWiki/Rcs/monotone.pm
11 +++ b/IkiWiki/Rcs/monotone.pm
12 @@ -186,8 +186,9 @@ sub rcs_update () { #{{{
13         check_config();
14  
15         if (defined($config{mtnsync}) && $config{mtnsync}) {
16 +               check_mergerc();
17                 if (system("mtn", "--root=$config{mtnrootdir}", "sync",
18 -                          "--quiet", "--ticker=none", 
19 +                          "--quiet", "--ticker=none", "--rcfile", $config{mtnmergerc},
20                            "--key", $config{mtnkey}) != 0) {
21                         debug("monotone sync failed before update");
22                 }
23 @@ -604,4 +605,9 @@ __DATA__
24                    return true
25               end
26         }
27 +       function note_netsync_revision_received(new_id, revision, certs, session_id)
28 +           if (program_exists_in_path("ikiwiki-netsync-hook")) then
29 +               execute("ikiwiki-netsync-hook", new_id)
30 +           end
31 +       end
32  EOF
33 diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
34 index 2103ea5..cff718c 100644
35 diff --git a/doc/ikiwiki.setup b/doc/ikiwiki.setup
36 index 1377315..0cbe27e 100644
37 --- a/doc/ikiwiki.setup
38 +++ b/doc/ikiwiki.setup
39 @@ -88,6 +88,16 @@ use IkiWiki::Setup::Standard {
40                 #       # Enable mail notifications of commits.
41                 #       notify => 1,
42                 #},
43 +               #{
44 +               #       # The monotone netsync revision received wrapper.
45 +               #       # Note that you also need to install a lua
46 +               #       # hook into monotone to make this work
47 +               #       # see: http://ikiwiki.info/rcs/monotone/
48 +               #       wrapper => "/usr/local/bin/ikiwiki-netsync-hook",
49 +               #       wrappermode => "04755",
50 +               #       # Enable mail notifications of commits.
51 +               #       notify => 1,
52 +               #},
53         ],
54  
55         # Generate rss feeds for blogs?
56 </pre>