X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/63439fa10b2b59e85337d7a0f71ddaa38dfb0018..6ead2573e91405c268ddd4e4072b3a7b30b6b461:/IkiWiki/Plugin/bzr.pm diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm index 783623dee..883007367 100644 --- a/IkiWiki/Plugin/bzr.pm +++ b/IkiWiki/Plugin/bzr.pm @@ -256,7 +256,23 @@ sub rcs_recentchanges ($) { } sub rcs_diff ($) { - # TODO + my $taintedrev=shift; + my ($rev) = $taintedrev =~ /^(\d+(\.\d+)*)$/; # untaint + + my $prevspec = "before:" . $rev; + my $revspec = "revno:" . $rev; + my @cmdline = ("bzr", "diff", "--old", $config{srcdir}, + "--new", $config{srcdir}, + "-r", $prevspec . ".." . $revspec); + open (my $out, "@cmdline |"); + + my @lines = <$out>; + if (wantarray) { + return @lines; + } + else { + return join("", @lines); + } } sub rcs_getctime ($) {