aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-30 02:29:28 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-30 02:29:28 +0100
commit246e93a300f81d67f5e6339e77cd533b815da9e9 (patch)
treec72ef5ae893c90a0805cd5a35db482dd3147f012
parentab414bc56c1ad2620a48902ad6bca1cf3ba11611 (diff)
downloadikiwiki-246e93a300f81d67f5e6339e77cd533b815da9e9.tar
ikiwiki-246e93a300f81d67f5e6339e77cd533b815da9e9.tar.gz
Expand file-id in diffurl in the bzr backend.
-rw-r--r--IkiWiki/Rcs/bzr.pm9
-rwxr-xr-xt/bazaar.t2
2 files changed, 7 insertions, 4 deletions
diff --git a/IkiWiki/Rcs/bzr.pm b/IkiWiki/Rcs/bzr.pm
index 43822fe8f..a04bfe1cb 100644
--- a/IkiWiki/Rcs/bzr.pm
+++ b/IkiWiki/Rcs/bzr.pm
@@ -95,7 +95,8 @@ sub rcs_recentchanges ($) { #{{{
eval q{use CGI 'escapeHTML'};
error($@) if $@;
- my @cmdline = ("bzr", "log", "-v", "--limit", $num, $config{srcdir});
+ my @cmdline = ("bzr", "log", "-v", "--show-ids", "--limit", $num,
+ $config{srcdir});
open (my $out, "@cmdline |");
eval q{use Date::Parse};
@@ -111,12 +112,14 @@ sub rcs_recentchanges ($) { #{{{
}
foreach my $file (split(/\n/, $info->{files})) {
+ my ($filename, $fileid) = split(/[ \t]+/, $file);
my $diffurl = $config{'diffurl'};
- $diffurl =~ s/\[\[file\]\]/$file/go;
+ $diffurl =~ s/\[\[file\]\]/$filename/go;
+ $diffurl =~ s/\[\[file-id\]\]/$fileid/go;
$diffurl =~ s/\[\[r2\]\]/$info->{revno}/go;
push @pages, {
- page => pagename($file),
+ page => pagename($filename),
diffurl => $diffurl,
};
}
diff --git a/t/bazaar.t b/t/bazaar.t
index 75534682b..f064814fe 100755
--- a/t/bazaar.t
+++ b/t/bazaar.t
@@ -17,7 +17,7 @@ use Test::More tests => 11;
BEGIN { use_ok("IkiWiki"); }
%config=IkiWiki::defaultconfig();
-$config{rcs} = "bazaar";
+$config{rcs} = "bzr";
$config{srcdir} = "$dir/repo";
IkiWiki::checkconfig();