Date: Tue, 20 Apr 2004 14:21:33 -0500 From: Jon Noack <noackjr@alumni.rice.edu> To: =?ISO-8859-1?Q?Ville_Skytt=E4?= <scop@FreeBSD.org> Cc: freebsd-cvsweb@FreeBSD.org Subject: Re: Linking to latest revision of a file Message-ID: <4085783D.9020005@alumni.rice.edu> In-Reply-To: <1082486185.5301.332.camel@bobcat.mine.nu> References: <20040420143806.GB13838@nosc.ja.net> <1082486185.5301.332.camel@bobcat.mine.nu>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On 4/20/2004 1:36 PM, Ville Skyttä wrote: > On Tue, 2004-04-20 at 17:38, Rob Evans wrote: >> CVSweb is up and running, but what I would like to do is link to >> "the newest" revision of files from a separate HTML page. In other >> words, a link along the lines of the following (but which actually >> works): >> >> http://<server>/cgi-bin/cvsweb.cgi/<filename>?rev=HEAD > > Hm, *that* should actually work. Ditto for "?rev=." It's a bug in > CVSweb 3.0, but works in 2.0.x; will take a look. Diff from slightly-modified 3.0.0 attached (might be a little fuzz, but hopefully it will still apply cleanly). I took the easy way out and just made it a separate if. Note that this is a definite hack and that I didn't really bother understanding everything -- it Just Works(tm)... Either '?rev=HEAD' or '?rev=.' should work. Jon Noack [-- Attachment #2 --] --- cvsweb.cgi.bak Fri Feb 27 11:10:17 2004 +++ cvsweb.cgi Tue Apr 20 14:12:21 2004 @@ -416,9 +416,13 @@ next; } my ($rev, $tag) = split(/:/, $t, 2); - ($input{$p}) = ($rev =~ /^(\d+(?:\.\d+)+)$/) - or fatal('500 Internal Error', - 'Invalid revision: <code>%s=%s</code>', $p, $t); + if ($rev eq 'HEAD' || $rev eq '.') { + $input{$p} = $rev; + } else { + ($input{$p}) = ($rev =~ /^(\d+(?:\.\d+)+)$/) + or fatal('500 Internal Error', + 'Invalid revision: <code>%s=%s</code>', $p, $t); + } if (defined($tag)) { ($tag) = ($tag =~ VALID_TAG1) or fatal('500 Internal Error',help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4085783D.9020005>
