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