X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/d110235130d10e468fb7ef1a647831c866e954f1..e4c765c64fc31ab13c911b716e80b07b4d1a0037:/IkiWiki/Plugin/bzr.pm?ds=inline 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 ($) {