Expand file-id in diffurl in the bzr backend.
authorJelmer Vernooij <jelmer@samba.org>
Wed, 30 Jan 2008 01:29:28 +0000 (02:29 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 30 Jan 2008 01:29:28 +0000 (02:29 +0100)
IkiWiki/Rcs/bzr.pm
t/bazaar.t

index 43822fe8ffad4cc7fe2f73689d0d97b3c8f757fa..a04bfe1cbe39a41d48937b4006215b1222ff2183 100644 (file)
@@ -95,7 +95,8 @@ sub rcs_recentchanges ($) { #{{{
        eval q{use CGI 'escapeHTML'};
        error($@) if $@;
 
        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};
        open (my $out, "@cmdline |");
 
        eval q{use Date::Parse};
@@ -111,12 +112,14 @@ sub rcs_recentchanges ($) { #{{{
                }
 
                foreach my $file (split(/\n/, $info->{files})) {
                }
 
                foreach my $file (split(/\n/, $info->{files})) {
+                       my ($filename, $fileid) = split(/[ \t]+/, $file);
                        my $diffurl = $config{'diffurl'};
                        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, {
                        $diffurl =~ s/\[\[r2\]\]/$info->{revno}/go;
 
                        push @pages, {
-                               page => pagename($file),
+                               page => pagename($filename),
                                diffurl => $diffurl,
                        };
                }
                                diffurl => $diffurl,
                        };
                }
index 75534682b6532cdc27981652d65ab79d09c8280d..f064814fe15cbdf5d6ee9a41a5f22df766ab8ab8 100755 (executable)
@@ -17,7 +17,7 @@ use Test::More tests => 11;
 BEGIN { use_ok("IkiWiki"); }
 
 %config=IkiWiki::defaultconfig();
 BEGIN { use_ok("IkiWiki"); }
 
 %config=IkiWiki::defaultconfig();
-$config{rcs} = "bazaar";
+$config{rcs} = "bzr";
 $config{srcdir} = "$dir/repo";
 IkiWiki::checkconfig();
 
 $config{srcdir} = "$dir/repo";
 IkiWiki::checkconfig();