aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/bugfix_for:___34__mtn:_operation_canceled:_Broken_pipe__34_____40__patch__41__.mdwn
blob: b7f38fd294e01eeca06c859c820b8a7edcea078b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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.

    diff -up ikiwiki/IkiWiki/Plugin/monotone.pm.orig ikiwiki/IkiWiki/Plugin/monotone.pm
    --- ikiwiki/IkiWiki/Plugin/monotone.pm.orig	2008-11-12 23:45:24.000000000 +0100
    +++ ikiwiki/IkiWiki/Plugin/monotone.pm	2008-12-16 12:41:38.000000000 +0100
    @@ -525,13 +525,12 @@ sub rcs_recentchanges ($) {
     	my $child = open(MTNLOG, "-|");
     	if (! $child) {
     		exec("mtn", "log", "--root=$config{mtnrootdir}", "--no-graph",
    -		     "--brief") || error("mtn log failed to run");
    +		     "--brief", "--last=$num") || error("mtn log failed to run");
     	}
     
    -	while (($num >= 0) and (my $line = <MTNLOG>)) {
    +	while (my $line = <MTNLOG>) {
     		if ($line =~ m/^($sha1_pattern)/) {
     			push @revs, $1;
    -			$num -= 1;
     		}
     	}
     	close MTNLOG || debug("mtn log exited $?");

> Thanks for the patch, and for testing the monotone backend.
> applied [[done]] --[[Joey]]