From owner-freebsd-cvsweb@FreeBSD.ORG Tue Apr 20 12:21:43 2004 Return-Path: Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E4B0E16A4D0 for ; Tue, 20 Apr 2004 12:21:43 -0700 (PDT) Received: from cmsrelay02.mx.net (cmsrelay02.mx.net [165.212.11.111]) by mx1.FreeBSD.org (Postfix) with SMTP id 8DB3243D5C for ; Tue, 20 Apr 2004 12:21:43 -0700 (PDT) (envelope-from noackjr@alumni.rice.edu) Received: from uadvg131.cms.usa.net (165.212.11.131) by cmsoutbound.mx.net with SMTP; 20 Apr 2004 19:21:39 -0000 Received: from optimator.noacks.org [66.140.17.8] by uadvg131.cms.usa.net (ASMTP/noackjr@usa.net) via mtad (C8.MAIN.3.13N) with ESMTP id 922iDTTVj0195M31; Tue, 20 Apr 2004 19:21:35 GMT X-USANET-Auth: 66.140.17.8 AUTH noackjr@usa.net optimator.noacks.org Received: from localhost (localhost [127.0.0.1]) by optimator.noacks.org (Postfix) with ESMTP id DF831617D; Tue, 20 Apr 2004 14:21:34 -0500 (CDT) Received: from optimator.noacks.org ([127.0.0.1]) by localhost (optimator.noacks.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 25030-07; Tue, 20 Apr 2004 14:21:33 -0500 (CDT) Received: from alumni.rice.edu (optimator [192.168.1.11]) by optimator.noacks.org (Postfix) with ESMTP id 7C4486176; Tue, 20 Apr 2004 14:21:33 -0500 (CDT) Message-ID: <4085783D.9020005@alumni.rice.edu> Date: Tue, 20 Apr 2004 14:21:33 -0500 From: Jon Noack User-Agent: Mozilla Thunderbird 0.6a (Windows/20040419) X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Ville_Skytt=E4?= References: <20040420143806.GB13838@nosc.ja.net> <1082486185.5301.332.camel@bobcat.mine.nu> In-Reply-To: <1082486185.5301.332.camel@bobcat.mine.nu> Content-Type: multipart/mixed; boundary="------------010608070407000000040404" X-Virus-Scanned: by amavisd-new at noacks.org cc: freebsd-cvsweb@FreeBSD.org Subject: Re: Linking to latest revision of a file X-BeenThere: freebsd-cvsweb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: noackjr@alumni.rice.edu List-Id: CVS Web maintenance mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 19:21:44 -0000 This is a multi-part message in MIME format. --------------010608070407000000040404 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable On 4/20/2004 1:36 PM, Ville Skytt=E4 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): >>=20 >> http:///cgi-bin/cvsweb.cgi/?rev=3DHEAD >=20 > Hm, *that* should actually work. Ditto for "?rev=3D." It's a bug in=20 > 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=20 hopefully it will still apply cleanly). I took the easy way out and=20 just made it a separate if. Note that this is a definite hack and that=20 I didn't really bother understanding everything -- it Just Works(tm)... Either '?rev=3DHEAD' or '?rev=3D.' should work. Jon Noack --------------010608070407000000040404 Content-Type: text/plain; name="cvsweb.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cvsweb.diff" --- 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: %s=%s', $p, $t); + if ($rev eq 'HEAD' || $rev eq '.') { + $input{$p} = $rev; + } else { + ($input{$p}) = ($rev =~ /^(\d+(?:\.\d+)+)$/) + or fatal('500 Internal Error', + 'Invalid revision: %s=%s', $p, $t); + } if (defined($tag)) { ($tag) = ($tag =~ VALID_TAG1) or fatal('500 Internal Error', --------------010608070407000000040404--