Date: Sun, 16 Dec 2007 21:35:33 -0700 (MST) From: John Hein <jhein@timing.com> To: FreeBSD-gnats-submit@FreeBSD.org Cc: peter@FreeBSD.org Subject: bin/118759: cvs -R doesn't handle non-existent tags Message-ID: <200712170435.lBH4ZXID083913@gromit.timing.com> Resent-Message-ID: <200712170440.lBH4e4Je010538@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 118759 >Category: bin >Synopsis: cvs -R doesn't handle non-existent tags >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Dec 17 04:40:03 UTC 2007 >Closed-Date: >Last-Modified: >Originator: John Hein >Release: FreeBSD 6.3-PRERELEASE i386 (and 7.x & -current) >Organization: >Environment: >Description: When using -R (or CVSREADONLYFS), cvs update, if invoked with a non-existent tag, will remove files instead of flagging an error. >How-To-Repeat: % env -i /usr/bin/cvs -v Concurrent Versions System (CVS) 1.11.17-FreeBSD (client/server) Copyright (c) 1989-2004 Brian Berliner, david d `zoo' zuhn, Jeff Polk, and other authors CVS may be copied only under the terms of the GNU General Public License, a copy of which can be found with the CVS distribution kit. Specify the --help option for further information about CVS % cd /usr/src/bin/mv # Without using -R, cvs handles non-existent tags in a reasonable # way... % env -i /usr/bin/cvs up -r nonexistenttag; echo status: $? cvs [update aborted]: no such tag nonexistenttag status: 1 # If using -R, cvs, instead of flagging an error, removes [unmodified] # files that don't have the tag. % env -i /usr/bin/cvs -R up -r nonexistenttag; echo status: $? cvs update: Updating . cvs update: Makefile is no longer in the repository cvs update: mv.1 is no longer in the repository cvs update: mv.c is no longer in the repository status: 0 In contrib/cvs/src/tag.c, tag_check_valid() returns early if readonlyfs is true. Thus it bypasses the tag checking that is done without -R. This isn't horrible since modified files won't be deleted. But it's not marked as an error, so it's hard to detect if running the cvs update from a script. And if the script included tagging of files, then you will silently miss tagging the files. That is just one example of a real problem caused by this bug. >Fix: I don't have a patch (presumably for src/tag.c) at the moment, but newer versions of cvs (such as 1.12.13) include support for -R and don't suffer from this problem. I'm wondering if it just might be time to update cvs in contrib. Rather than patch the 1.11.17-FreeBSD version, I might just come up with a patch that's an import of 1.12.13 (unless someone beats me to it). Not only does 1.12.13 support -R, but it has some nice new features that I like, notably the ability to update (or diff, etc.) to a specified date on a branch (e.g., cvs up -Pd -rFOO-1-2:20071207 or cvs diff -rFOO-1-2:20050101 -rFOO-1-2:20070801). Doing so is difficult with the 1.11.17. Are there any regression tests I can run that test cvs before importing a new version to FreeBSD? [peter@, one-time cvs-meister, cc'd for comment] >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712170435.lBH4ZXID083913>