add spec dependency
[ikiwiki] / doc / bugs / bugfix_for:___34__mtn:_operation_canceled:_Broken_pipe__34_____40__patch__41__.mdwn
1 When using monotone as revision control system, a "mtn: operation canceled: Broken pipe" message is printed. Reason is that, in a call to mtn, the pipe is closed before mtn has done all its output. This patch fixes the problem.
2
3     diff -up ikiwiki/IkiWiki/Plugin/monotone.pm.orig ikiwiki/IkiWiki/Plugin/monotone.pm
4     --- ikiwiki/IkiWiki/Plugin/monotone.pm.orig 2008-11-12 23:45:24.000000000 +0100
5     +++ ikiwiki/IkiWiki/Plugin/monotone.pm      2008-12-16 12:41:38.000000000 +0100
6     @@ -525,13 +525,12 @@ sub rcs_recentchanges ($) {
7         my $child = open(MTNLOG, "-|");
8         if (! $child) {
9                 exec("mtn", "log", "--root=$config{mtnrootdir}", "--no-graph",
10     -                "--brief") || error("mtn log failed to run");
11     +                "--brief", "--last=$num") || error("mtn log failed to run");
12         }
13      
14     -   while (($num >= 0) and (my $line = <MTNLOG>)) {
15     +   while (my $line = <MTNLOG>) {
16                 if ($line =~ m/^($sha1_pattern)/) {
17                         push @revs, $1;
18     -                   $num -= 1;
19                 }
20         }
21         close MTNLOG || debug("mtn log exited $?");
22
23 > Thanks for the patch, and for testing the monotone backend.
24 > applied [[done]] --[[Joey]]