summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-02-26 14:09:26 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-02-26 14:09:26 -0500
commit596b2906fdc863fac2a3c86abbdb39416eee1961 (patch)
tree72de45306785d8d08c7a4b497db493d815fce205 /IkiWiki
parent457d330758ffe0935837ed38a93608c519a62403 (diff)
bzr: Add missing rcs_diff. (liw)
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/bzr.pm18
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 ($) {