Expand file-id in diffurl in the bzr backend.

master
Jelmer Vernooij 2008-01-30 02:29:28 +01:00
parent ab414bc56c
commit 246e93a300
2 changed files with 7 additions and 4 deletions

View File

@ -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,
};
}

View File

@ -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();