Bug 144496 lxr for a branch should link to bonsai for the branch

r=preed@mozilla.com
This commit is contained in:
timeless%mozdev.org 2005-12-27 16:23:20 +00:00
Родитель 6280075dfa
Коммит 03eb1f05a7
3 изменённых файлов: 64 добавлений и 11 удалений

Просмотреть файл

@ -1,4 +1,4 @@
# $Id: Common.pm,v 1.28 2005-12-21 05:28:13 timeless%mozdev.org Exp $
# $Id: Common.pm,v 1.29 2005-12-27 16:23:20 timeless%mozdev.org Exp $
package LXR::Common;
@ -569,10 +569,61 @@ sub bannerexpand {
}
}
sub pathname {
return $Path->{'virtf'};
sub cvsentriesexpand {
my ($entryrev, $entrybranch);
local $,=" | ";
my ($entriespath, $entryname) = split m|/(?!.*/)|, $Path->{'realf'};
if (open(CVSENTRIES, "$entriespath/CVS/Entries")) {
while (<CVSENTRIES>) {
next unless m|^/\Q$entryname\E/([^/]*)/[^/]*/[^/]*/(.*)|;
($entryrev,$entrybranch)=($1,$2);
$entrybranch =~ s/^T//;
$entrybranch ||= 'HEAD';
}
close(CVSENTRIES);
}
return ($entryrev, $entrybranch);
}
sub cvstagexpand {
my $entrybranch;
if (open(CVSTAG, " $Path->{'real'}/CVS/Tag")) {
while (<CVSTAG>) {
next unless m|^T(.*)$|;
$entrybranch = $1;
}
close(CVSTAG);
}
return $entrybranch || 'HEAD';
}
sub cvsversionexpand {
if ($who eq 'source') {
my ($entryrev,undef) = cvsentriesexpand();
return $entryrev;
}
if ($who eq 'sourcedir') {
return cvstagexpand();
}
return('');
}
sub cvsbranchexpand {
if ($who eq 'source') {
my (undef,$entrybranch) = cvsentriesexpand();
return $entrybranch;
}
if ($who eq 'sourcedir') {
return cvstagexpand();
}
return('');
}
sub pathname {
my $prefix = '';
$prefix = '/' . $Conf->prefix if defined $Conf->prefix;
return (url_quote ($prefix . $Path->{'virtf'}));
}
sub treename {
return $Conf->{'treename'};
@ -804,6 +855,8 @@ sub makeheader {
('treename', \&treename),
('modes', \&modeexpand),
('bonsaicvsroot', \&bonsaicvsroot),
('cvsversion', \&cvsversionexpand),
('cvsbranch', \&cvsbranchexpand),
('variables', \&varexpand)));
}

Просмотреть файл

@ -26,8 +26,8 @@
<TABLE BORDER CELLPADDING=12 CELLSPACING=0>
<TR>
<TD NOWRAP BGCOLOR="#FAFAFA">
<A HREF="http://bonsai.mozilla.org/cvslog.cgi?file=mozilla$pathname">CVS Log</A><BR>
<A HREF="http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla$pathname">CVS Blame</A><BR>
<A HREF="http://bonsai.mozilla.org/cvslog.cgi?file=mozilla$pathname&rev=$cvsbranch&mark=$cvsversion">CVS Log</A><BR>
<A HREF="http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla$pathname&rev=$cvsversion">CVS Blame</A><BR>
<BR>
</TD>
</TR>
@ -44,9 +44,9 @@
changes to<BR>this file in<BR>the last:
</TD>
<TD NOWRAP>
<A HREF="http://bonsai.mozilla.org/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=day">day</A><BR>
<A HREF="http://bonsai.mozilla.org/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=week">week</A><BR>
<A HREF="http://bonsai.mozilla.org/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=month">month</A><BR>
<A HREF="http://bonsai.mozilla.org/cvsquery.cgi?branch=$cvsbranch&file=mozilla$pathname&date=day">day</A><BR>
<A HREF="http://bonsai.mozilla.org/cvsquery.cgi?branch=$cvsbranch&file=mozilla$pathname&date=week">week</A><BR>
<A HREF="http://bonsai.mozilla.org/cvsquery.cgi?branch=$cvsbranch&file=mozilla$pathname&date=month">month</A><BR>
</TD>
</TR>
</TABLE>

Просмотреть файл

@ -32,9 +32,9 @@
changes to<BR>this directory<BR>in the last:
</TD>
<TD NOWRAP>
<A HREF="http://bonsai.mozilla.org/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=day">day</A><BR>
<A HREF="http://bonsai.mozilla.org/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=week">week</A><BR>
<A HREF="http://bonsai.mozilla.org/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=month">month</A><BR>
<A HREF="http://bonsai.mozilla.org/cvsquery.cgi?branch=$cvsversion&file=mozilla$pathname&date=day">day</A><BR>
<A HREF="http://bonsai.mozilla.org/cvsquery.cgi?branch=$cvsversion&file=mozilla$pathname&date=week">week</A><BR>
<A HREF="http://bonsai.mozilla.org/cvsquery.cgi?branch=$cvsversion&file=mozilla$pathname&date=month">month</A><BR>
</TD>
</TR>
</TABLE>