diff options
author | Amitai Schlair <schmonz-web-ikiwiki@schmonz.com> | 2012-02-05 01:20:52 -0500 |
---|---|---|
committer | Amitai Schlair <schmonz-web-ikiwiki@schmonz.com> | 2012-02-05 01:20:52 -0500 |
commit | 6753235d98a3903364af26c0614106c47d93ae35 (patch) | |
tree | 83137fd75b06f4f6cc40be4c0d035040a2193f55 /IkiWiki | |
parent | a125cd5f79b09e827eaeb20b75b08594f7e8d12f (diff) | |
download | ikiwiki-6753235d98a3903364af26c0614106c47d93ae35.tar ikiwiki-6753235d98a3903364af26c0614106c47d93ae35.tar.gz |
Write rcs_diff() tests according to the API spec, then make them pass.
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/cvs.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/cvs.pm b/IkiWiki/Plugin/cvs.pm index 0a6cbfaf6..8e0e2a4da 100644 --- a/IkiWiki/Plugin/cvs.pm +++ b/IkiWiki/Plugin/cvs.pm @@ -394,11 +394,15 @@ sub rcs_diff ($;$) { my @cvsps = `env TZ=UTC cvsps -q --cvs-direct -z 30 -g -s $rev`; my $blank_lines_seen = 0; + # skip log, get to the diff while (my $line = shift @cvsps) { $blank_lines_seen++ if ($line =~ /^$/); last if $blank_lines_seen == 2; } + @cvsps = @cvsps[0..$maxlines-1] + if defined $maxlines && @cvsps > $maxlines; + if (wantarray) { return @cvsps; } |