From 1c06aed378e579b7396937fdff4e38ea0482ff5b Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kodama.kitenet.net>
Date: Thu, 14 Feb 2008 16:10:33 -0500
Subject: [PATCH] * monotone: Add code to default mergerc file to run  
 _MTN/ikiwiki-netsync-hook when a commit is merged in from the net.

---
 IkiWiki/Rcs/monotone.pm | 5 +++++
 debian/changelog        | 2 ++
 doc/ikiwiki.setup       | 5 +++++
 3 files changed, 12 insertions(+)

diff --git a/IkiWiki/Rcs/monotone.pm b/IkiWiki/Rcs/monotone.pm
index c4a6d9864..6a156892a 100644
--- a/IkiWiki/Rcs/monotone.pm
+++ b/IkiWiki/Rcs/monotone.pm
@@ -136,6 +136,11 @@ sub check_mergerc () { #{{{
 		debug("$mergerc doesn't exist. Creating file with default mergers.");
 		open (my $out, ">", $mergerc) or error("can't open $mergerc: $!");
 		print $out <DATA>;
+		print $out <<"EOF";
+	function note_netsync_revision_received(new_id, revision, certs, session_id)
+		execute("$config{mtnrootdir}/_MTN/ikiwiki-netsync-hook", new_id)
+	end
+EOF
 		close $out;
 	}
 } #}}}
diff --git a/debian/changelog b/debian/changelog
index 02d6aa499..02de6fbbb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,8 @@ ikiwiki (2.40) UNRELEASED; urgency=low
   * Fix a bug where user A created a page concurrently with user B, and
     when B previewed it would redirect B to A's new page, losing B's work.
     Instead, don't redirect and let conflict handling resolve it.
+  * monotone: Add code to default mergerc file to run
+    _MTN/ikiwiki-netsync-hook when a commit is merged in from the net.
 
  -- Josh Triplett <josh@freedesktop.org>  Sun, 10 Feb 2008 13:18:58 -0800
 
diff --git a/doc/ikiwiki.setup b/doc/ikiwiki.setup
index 0094bcb2a..2c9b02071 100644
--- a/doc/ikiwiki.setup
+++ b/doc/ikiwiki.setup
@@ -90,6 +90,11 @@ use IkiWiki::Setup::Standard {
 		#	wrapper => "/git/wiki.git/hooks/post-update",
 		#	wrappermode => "06755",
 		#},
+		#{
+		#	# The monotone netsync hook.
+		#	wrapper => "path/to/root/of/workspace/_MTN/ikiwiki-netsync-hook",
+		#	wrappermode => "06755",
+		#},
 	],
 
 	# Default to generating rss feeds for blogs?
-- 
2.39.5