diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-02-26 14:09:26 -0500 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-02-26 14:09:26 -0500 |
commit | 596b2906fdc863fac2a3c86abbdb39416eee1961 (patch) | |
tree | 72de45306785d8d08c7a4b497db493d815fce205 /IkiWiki | |
parent | 457d330758ffe0935837ed38a93608c519a62403 (diff) |
bzr: Add missing rcs_diff. (liw)
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/bzr.pm | 18 |
1 files changed, 17 insertions, 1 deletions
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 ($) { |