Photos
Blog
Projects
vanrenterghem.biz
projects
/
git.ikiwiki.info.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
img: restrict to JPEG, PNG and GIF images by default
[git.ikiwiki.info.git]
/
IkiWiki
/
Plugin
/
darcs.pm
diff --git
a/IkiWiki/Plugin/darcs.pm
b/IkiWiki/Plugin/darcs.pm
index 0f63b8807902fbd0d3f2478b1a2c66cbf6066e24..646f65df10688087decd275e0be6109203573aae 100644
(file)
--- a/
IkiWiki/Plugin/darcs.pm
+++ b/
IkiWiki/Plugin/darcs.pm
@@
-3,6
+3,7
@@
package IkiWiki::Plugin::darcs;
use warnings;
use strict;
use warnings;
use strict;
+use URI::Escape q{uri_escape_utf8};
use IkiWiki;
sub import {
use IkiWiki;
sub import {
@@
-336,7
+337,8
@@
sub rcs_recentchanges ($) {
foreach my $f (@files) {
my $d = defined $config{'diffurl'} ? $config{'diffurl'} : "";
foreach my $f (@files) {
my $d = defined $config{'diffurl'} ? $config{'diffurl'} : "";
- $d =~ s/\[\[file\]\]/$f/go;
+ my $ef = uri_escape_utf8($f);
+ $d =~ s/\[\[file\]\]/$ef/go;
$d =~ s/\[\[hash\]\]/$hash/go;
push @pg, {
$d =~ s/\[\[hash\]\]/$hash/go;
push @pg, {
@@
-373,11
+375,14
@@
sub rcs_recentchanges ($) {
return @ret;
}
return @ret;
}
-sub rcs_diff ($) {
+sub rcs_diff ($
;$
) {
my $rev=shift;
my $rev=shift;
+ my $maxlines=shift;
my @lines;
my @lines;
- foreach my $line (silentsystem("darcs", "diff", "--match", "hash ".$rev)) {
+ my $repodir=$config{srcdir};
+ foreach my $line (`darcs diff --repodir $repodir --match 'hash $rev'`) {
if (@lines || $line=~/^diff/) {
if (@lines || $line=~/^diff/) {
+ last if defined $maxlines && @lines == $maxlines;
push @lines, $line."\n";
}
}
push @lines, $line."\n";
}
}