X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/f398ad035b973608d380c9939ea845d8e2a0cdc2..414ccfb1e298a722d2afa8b8540ca84dc1ccc6f2:/IkiWiki/Plugin/bzr.pm diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm index 562d5d389..3bc4ea8dd 100644 --- a/IkiWiki/Plugin/bzr.pm +++ b/IkiWiki/Plugin/bzr.pm @@ -271,8 +271,9 @@ sub rcs_recentchanges ($) { return @ret; } -sub rcs_diff ($) { +sub rcs_diff ($;$) { my $taintedrev=shift; + my $maxlines=shift; my ($rev) = $taintedrev =~ /^(\d+(\.\d+)*)$/; # untaint my $prevspec = "before:" . $rev; @@ -281,8 +282,11 @@ sub rcs_diff ($) { "--new", $config{srcdir}, "-r", $prevspec . ".." . $revspec); open (my $out, "@cmdline |"); - - my @lines = <$out>; + my @lines; + while (my $line=<$out>) { + last if defined $maxlines && @lines == $maxlines; + push @lines, $line; + } if (wantarray) { return @lines; }