1 Version 2.0 of bzr seems to break the bzr plugin.
3 I traced this to the bzr_log method in the plugin, and patching that seems to fix it. The plugin just needs to parse the input little bit differently.
6 From fb897114124e627fd3acf5af8e784c9a77419a81 Mon Sep 17 00:00:00 2001
7 From: Lars Wirzenius <liw@liw.fi>
8 Date: Sun, 4 Apr 2010 21:05:07 +1200
9 Subject: [PATCH] Fix bzr plugin to work with bzr 2.0.
11 The output of "bzr log" seems to have changed a bit, so we change the
12 parsing accordingly. This has not been tested with earlier versions of
15 Several problems seemed to occur, all in the bzr_log subroutine:
17 1. The @infos list would contain an empty hash, which would confuse the
19 2. This was because bzr_log would push an empty anonymous hash to the
20 list whenever it thought a new record would start.
21 3. However, a new record marker (now?) also happens at th end of bzr log
23 4. Now we collect the record to a hash that gets pushed to the list only
25 5. Also, sometimes bzr log outputs "revno: 1234 [merge]", so we catch only
27 6. Finally, there may be non-headers at the of the output, so we ignore
30 IkiWiki/Plugin/bzr.pm | 23 ++++++++++++++++-------
31 1 files changed, 16 insertions(+), 7 deletions(-)
33 diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm
34 index 1ffdc23..e813331 100644
35 --- a/IkiWiki/Plugin/bzr.pm
36 +++ b/IkiWiki/Plugin/bzr.pm
37 @@ -73,28 +73,37 @@ sub bzr_log ($) {
45 if ($line =~ /^message:/) {
47 - $infos[$#infos]{$key} = "";
50 elsif ($line =~ /^(modified|added|renamed|renamed and modified|removed):/) {
52 - unless (defined($infos[$#infos]{$key})) { $infos[$#infos]{$key} = ""; }
53 + unless (defined($$hash{$key})) { $$hash{$key} = ""; }
55 elsif (defined($key) and $line =~ /^ (.*)/) {
56 - $infos[$#infos]{$key} .= "$1\n";
57 + $$hash{$key} .= "$1\n";
59 elsif ($line eq "------------------------------------------------------------\n") {
61 + push (@infos, $hash);
68 + elsif ($line =~ /: /) {
70 - ($key, $value) = split /: +/, $line, 2;
71 - $infos[$#infos]{$key} = $value;
72 + if ($line =~ /^revno: (\d+)/) {
76 + ($key, $value) = split /: +/, $line, 2;
78 + $$hash{$key} = $value;