X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/d110235130d10e468fb7ef1a647831c866e954f1..e3ccf393c6081e413e1da0eae46ac937a032a13b:/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 ($) {