From fenner@research.att.com  Fri Jul  5 08:12:51 2002
Return-Path: <fenner@research.att.com>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DBCFA37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  5 Jul 2002 08:12:51 -0700 (PDT)
Received: from nectar.attlabs.att.com (AMontsouris-108-1-16-250.abo.wanadoo.fr [80.15.145.250])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D276C43E3B
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  5 Jul 2002 08:12:49 -0700 (PDT)
	(envelope-from fenner@research.att.com)
Received: from nectar.attlabs.att.com (localhost [IPv6:::1])
	by nectar.attlabs.att.com (8.12.3/8.11.6) with ESMTP id g65FCgWH013448
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 5 Jul 2002 17:12:43 +0200 (CEST)
	(envelope-from fenner@nectar.attlabs.att.com)
Received: (from fenner@localhost)
	by nectar.attlabs.att.com (8.12.3/8.12.3/Submit) id g65FCe5O013447;
	Fri, 5 Jul 2002 17:12:40 +0200 (CEST)
Message-Id: <200207051512.g65FCe5O013447@nectar.attlabs.att.com>
Date: Fri, 5 Jul 2002 17:12:40 +0200 (CEST)
From: Bill Fenner <fenner@research.att.com>
Reply-To: Bill Fenner <fenner@research.att.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: CVS client doesn't upload new files created by "cvs update -j"
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         40227
>Category:       bin
>Synopsis:       [patch] CVS client doesn't upload new files created by "cvs update -j"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 05 08:20:01 PDT 2002
>Closed-Date:    Thu Oct 06 12:48:51 GMT 2005
>Last-Modified:  Thu Oct 06 12:48:51 GMT 2005
>Originator:     Bill Fenner
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
AT&T Labs - Research
>Environment:
System: FreeBSD nectar.attlabs.att.com 4.6-STABLE FreeBSD 4.6-STABLE #0: Sat Jun 22 11:58:01 PDT 2002 root@nectar.attlabs.att.com:/usr/obj/usr/src/sys/GENERIC i386



Concurrent Versions System (CVS) 1.11.1p1-FreeBSD (client/server)

Copyright (c) 1989-2001 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
	
>Description:
	

I was updating contrib software via my normal steps:

1. cvs co -rRELENG_4 foo
2. cvs update -jr1 -jr2 foo
3. <fix conflicts>
4. <build and test>
5. fcvs commit foo

When I did this with tcpdump, I got weird cvs server errors for each
new file that "cvs update" created:

Checking in contrib_tcpdump/ieee802_11.h;
/home/ncvs/src/contrib/tcpdump/ieee802_11.h,v  <--  ieee802_11.h
cvs server: ieee802_11.h: No such file or directory
cvs [server aborted]: error diffing ieee802_11.h
cvs commit: saving log message in /tmp/cvsed1Xq0

I went through this painful process for each new file in the tcpdump
import, and got really frustrated - frustrated enough to dive into
the CVS code.

Luckily, I had another MFC to do - libpcap.  I watched the CVS client/server
communication and saw that CVS thought that the new files were unmodified
so didn't need to be uploaded, even though they were also new.  This is
a bug in "cvs update" -- if it creates a new file, it should not put the
timestamp in.  It can be worked around in the cvs client code - it should
upload all new files, even if the timestamp on them is the same.


>How-To-Repeat:
	

Use cvs update -jfoo -jbar in a way that creates a new file on a branch.
Commit using remote CVS.

>Fix:

	

This is the cvs client workaround.

Index: client.c
===================================================================
RCS file: /home/ncvs/src/contrib/cvs/src/client.c,v
retrieving revision 1.2.2.3
diff -u -r1.2.2.3 client.c
--- client.c	28 Oct 2001 21:32:07 -0000	1.2.2.3
+++ client.c	5 Jul 2002 14:37:41 -0000
@@ -5226,7 +5226,8 @@
     }
     else if (vers->ts_rcs == NULL
 	     || args->force
-	     || strcmp (vers->ts_user, vers->ts_rcs) != 0)
+	     || strcmp (vers->ts_user, vers->ts_rcs) != 0
+	     || (vers->vn_user && *vers->vn_user == '0'))
     {
 	if (args->no_contents
 	    && supported_request ("Is-modified"))

I haven't looked at the merge code to see if it would be easy to
do the fix there (too|instead).

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: rodrigc 
State-Changed-When: Thu Oct 6 12:44:35 GMT 2005 
State-Changed-Why:  
This patch seems to be in the CVS client used in FreeBSD for quite a while 
now. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40227 
>Unformatted:
Add "[patch]" tp synopsis -- vs@2004-07-29
