Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
[ikiwiki] / 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.
3
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]]
6
7 > I think this was fixed in version 2.40. --[[Joey]] [[!tag done]]
8
9 <pre>
10 diff --git a/IkiWiki/Rcs/monotone.pm b/IkiWiki/Rcs/monotone.pm
11 index cde6029..34f8f96 100644
12 --- a/IkiWiki/Rcs/monotone.pm
13 +++ b/IkiWiki/Rcs/monotone.pm
14 @@ -186,8 +186,9 @@ sub rcs_update () { #{{{
15         check_config();
16  
17         if (defined($config{mtnsync}) && $config{mtnsync}) {
18 +               check_mergerc();
19                 if (system("mtn", "--root=$config{mtnrootdir}", "sync",
20 -                          "--quiet", "--ticker=none", 
21 +                          "--quiet", "--ticker=none", "--rcfile", $config{mtnmergerc},
22                            "--key", $config{mtnkey}) != 0) {
23                         debug("monotone sync failed before update");
24                 }
25 @@ -604,4 +605,9 @@ __DATA__
26                    return true
27               end
28         }
29 +       function note_netsync_revision_received(new_id, revision, certs, session_id)
30 +           if (program_exists_in_path("ikiwiki-netsync-hook")) then
31 +               execute("ikiwiki-netsync-hook", new_id)
32 +           end
33 +       end
34  EOF
35 diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
36 index 2103ea5..cff718c 100644
37 diff --git a/doc/ikiwiki.setup b/doc/ikiwiki.setup
38 index 1377315..0cbe27e 100644
39 --- a/doc/ikiwiki.setup
40 +++ b/doc/ikiwiki.setup
41 @@ -88,6 +88,16 @@ use IkiWiki::Setup::Standard {
42                 #       # Enable mail notifications of commits.
43                 #       notify => 1,
44                 #},
45 +               #{
46 +               #       # The monotone netsync revision received wrapper.
47 +               #       # Note that you also need to install a lua
48 +               #       # hook into monotone to make this work
49 +               #       # see: http://ikiwiki.info/rcs/monotone/
50 +               #       wrapper => "/usr/local/bin/ikiwiki-netsync-hook",
51 +               #       wrappermode => "04755",
52 +               #       # Enable mail notifications of commits.
53 +               #       notify => 1,
54 +               #},
55         ],
56  
57         # Generate rss feeds for blogs?
58 </pre>