bzr: Add missing rcs_diff. (liw)
authorJoey Hess <joey@gnu.kitenet.net>
Thu, 26 Feb 2009 19:09:26 +0000 (14:09 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Thu, 26 Feb 2009 19:09:26 +0000 (14:09 -0500)
IkiWiki/Plugin/bzr.pm
debian/changelog
doc/bugs/bzr_plugin_does_not_define_rcs__95__diff.mdwn

index 783623dee1d841207be58412de21d8a2f24567d6..8830073672663b77d2e21fb837a15a913b7b6c0d 100644 (file)
@@ -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 ($) {
index 68d08ad8e6095e7d32954e3203dab46164845b01..90b672e8d5cb49209cc807cea5f94b6b29d377fe 100644 (file)
@@ -10,7 +10,7 @@ ikiwiki (3.05) UNRELEASED; urgency=low
   * Add tagged() PageSpec.
   * Updated German translation (Kai Wasserbäch). Closes: #516770
   * Setup automator: Prompt for password twice. Closes: #516973
-  * bzr: Add missing stub rcs_diff.
+  * bzr: Add missing rcs_diff. (liw)
   * comments: Avoid showing comment moderation button in prefs to non-admins.
 
  -- Joey Hess <joeyh@debian.org>  Sun, 15 Feb 2009 20:11:57 -0500
index 110f769c736fe807c0a309af8b1262d289e570c2..0294ec62ea35af8716d1bbb787881577870fb36b 100644 (file)
@@ -24,38 +24,4 @@ Grepping to verify absence of rcs_diff:
 >> seems to work. I am unfortunately not ready to set up a git repository that you
 >> can pull from. --liw
 
-    diff --git a/IkiWiki/Plugin/.bzr.pm.swp b/IkiWiki/Plugin/.bzr.pm.swp
-    new file mode 100644
-    index 0000000..712120c
-    Binary files /dev/null and b/IkiWiki/Plugin/.bzr.pm.swp differ
-    diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm
-    index 783623d..f1d5854 100644
-    --- a/IkiWiki/Plugin/bzr.pm
-    +++ b/IkiWiki/Plugin/bzr.pm
-    @@ -256,7 +256,25 @@ sub rcs_recentchanges ($) {
-     }
-   
-     sub rcs_diff ($) {
-    -   # TODO
-    +        my $taintedrev=shift;
-    +   my ($rev) = $taintedrev =~ /^(\d+(\.\d+)*)$/; # untaint
-    +           print STDERR "taintedrev: $taintedrev\nrev: $rev\n";
-    +
-    +   my $prevspec = "before:" . $rev;
-    +   my $revspec = "revno:" . $rev;
-    +        my @cmdline = ("bzr", "diff", "--old", $config{srcdir},
-    +                  "--new", $config{srcdir},
-    +                  "-r", $prevspec . ".." . $revspec);
-    +   print STDERR "cmdline: @cmdline\n";
-    +        open (my $out, "@cmdline |");
-    +
-    +   my @lines = <$out>;
-    +        if (wantarray) {
-    +                return @lines;
-    +        }
-    +        else {
-    +                return join("", @lines);
-    +        }
-     }
-   
-     sub rcs_getctime ($) {
+[[done]] --[[Joey]]