From owner-cvs-all Thu Aug 24 13:30:41 2000 Delivered-To: cvs-all@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id A9A8637B423; Thu, 24 Aug 2000 13:30:32 -0700 (PDT) Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=root) by scientia.demon.co.uk with esmtp (Exim 3.16 #1) id 13S231-000K9I-00; Thu, 24 Aug 2000 19:48:19 +0100 Received: (from ben@localhost) by strontium.scientia.demon.co.uk (8.9.3/8.9.3) id TAA16503; Thu, 24 Aug 2000 19:48:19 +0100 (BST) (envelope-from ben) Date: Thu, 24 Aug 2000 19:48:19 +0100 From: Ben Smithurst To: Josef Karthauser Cc: Alfred Perlstein , Doug Barton , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvsweb links in cvs commit messages Message-ID: <20000824194818.B28527@strontium.scientia.demon.co.uk> References: <20000823093626.Z4854@fw.wintelcom.net> <20000823120642.C4854@fw.wintelcom.net> <20000823202312.S20036@strontium.scientia.demon.co.uk> <20000824175901.C8962@pavilion.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20000824175901.C8962@pavilion.net> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Josef Karthauser wrote: > On a related thing it would be really useful to be able to do: > > http://www.FreeBSD.org/cgi/cvsweb.cgi/src/bin/chmod/chmod.1?rev=HEAD > > to pull out head release of a file. Ah, now that's easy. :-) Try the diff below. revcmp() doesn't work for symbolic names, but I don't think that's too important. It doesn't work for diffs between say HEAD and RELENG_4 though, and trying the equivalent command at the prompt gives: ben@magnesium:~/bsdwork/www/en/cgi$ rcsdiff -u -rHEAD -rRELENG_4 /usr/cvs/src/Makefile.inc1 =================================================================== RCS file: /usr/cvs/src/Makefile.inc1,v rcsdiff: /usr/cvs/src/Makefile.inc1,v: Symbolic name `HEAD' is undefined. How would you get around that? You can't use cvs itself, unless you have a checked out version. :-( ben@magnesium:~$ cvs -Rd /usr/cvs diff -rHEAD -rRELENG_4 src/Makefile.inc1 cvs [diff aborted]: no such directory `src' hmm. Index: cvsweb.cgi =================================================================== RCS file: /usr/cvs/www/en/cgi/cvsweb.cgi,v retrieving revision 1.47 diff -u -r1.47 cvsweb.cgi --- cvsweb.cgi 2000/08/15 08:47:40 1.47 +++ cvsweb.cgi 2000/08/24 18:42:11 @@ -960,6 +960,8 @@ my(@r2) = split(/\./, $rev2); my($a,$b); + return 0 if $rev1 =~ /[A-Za-z_]/ || $rev2 =~ /[A-Za-z_]/; + while (($a = shift(@r1)) && ($b = shift(@r2))) { if ($a != $b) { return $a <=> $b; @@ -1070,7 +1072,7 @@ # make sure the revisions a wellformed, for security # reasons .. - if (!($rev =~ /^[\d\.]+$/)) { + if (!($rev =~ /^[A-Za-z_\d\.]+$/)) { &fatal("404 Not Found", "Malformed query \"$ENV{QUERY_STRING}\""); } @@ -1223,7 +1225,7 @@ # make sure the revisions a wellformed, for security # reasons .. - if (defined($rev) && !($rev =~ /^[\d\.]+$/)) { + if (defined($rev) && !($rev =~ /^[A-Za-z_\d\.]+$/)) { &fatal("404 Not Found", "Malformed query \"$ENV{QUERY_STRING}\""); } @@ -1378,7 +1380,7 @@ } # make sure the revisions a wellformed, for security # reasons .. - if (!($rev1 =~ /^[\d\.]+$/) || !($rev2 =~ /^[\d\.]+$/)) { + if (!($rev1 =~ /^[A-Za-z_\d\.]+$/) || !($rev2 =~ /^[A-Za-z_\d\.]+$/)) { &fatal("404 Not Found", "Malformed query \"$ENV{QUERY_STRING}\""); } -- Ben Smithurst / ben@FreeBSD.org / PGP: 0x99392F7D To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message