aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/bzr_plugin_does_not_define_rcs__95__diff.mdwn
diff options
context:
space:
mode:
authorhttp://liw.fi/ <http://liw.fi/@web>2009-02-26 03:07:29 -0500
committerJoey Hess <joey@kitenet.net>2009-02-26 03:07:29 -0500
commit457d330758ffe0935837ed38a93608c519a62403 (patch)
treed486cc241d47447b282df4fc2f4aa938cdcf9275 /doc/bugs/bzr_plugin_does_not_define_rcs__95__diff.mdwn
parent4efc5e7b5ab4d3aa8c7576c7dd3970b2548f85c6 (diff)
downloadikiwiki-457d330758ffe0935837ed38a93608c519a62403.tar
ikiwiki-457d330758ffe0935837ed38a93608c519a62403.tar.gz
Diffstat (limited to 'doc/bugs/bzr_plugin_does_not_define_rcs__95__diff.mdwn')
-rw-r--r--doc/bugs/bzr_plugin_does_not_define_rcs__95__diff.mdwn40
1 files changed, 40 insertions, 0 deletions
diff --git a/doc/bugs/bzr_plugin_does_not_define_rcs__95__diff.mdwn b/doc/bugs/bzr_plugin_does_not_define_rcs__95__diff.mdwn
index 60d3a7b95..110f769c7 100644
--- a/doc/bugs/bzr_plugin_does_not_define_rcs__95__diff.mdwn
+++ b/doc/bugs/bzr_plugin_does_not_define_rcs__95__diff.mdwn
@@ -19,3 +19,43 @@ Grepping to verify absence of rcs_diff:
>> I'll see if I can make a patch. The bzr command to get the revision would
>> look like this: bzr diff -r revno:$PREV:/path/to/src..revno:$REVNO:/path/to/src
>> (where $PREV would be $REVNO minus one). --liw
+
+>> Sorry, that was not entirely correct, for some reason. I'll add a patch below that
+>> 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 ($) {