bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS ignores new files on branch if already on trunk, caused DATA LOSS


From: Jakob Bøhm
Subject: CVS ignores new files on branch if already on trunk, caused DATA LOSS
Date: Tue, 3 Apr 2001 11:53:01 +0200

The following bug has been reproduced with cvs 1.10.5 and 1.11 on NT
and 1.10.8 on RedHat Linux.  Each using a :local: repository.

When a working directory contains a new file which has not yet been
subjected to "cvs add", both "cvs -n -q update" and "cvs release -d"
normally report the new file with a "?" (question mark) symbol.  I rely
heavily on this behavior to determine if any files need to be added.

However if the working directory is on a branch and a file by that name
is already checked in on the trunk cvs does not list the file and generally
behaves as if the file was in cvsignore.  This bug caused me to loose
entire files when backporting a fix from the trunk to a branch.

I suggest files which are not under cvs control in the working directory
are flagged with a "?" even if a file by the same name happens to be
in the repository.

The following bash script reproduces the bug.  Before running the script
export TMP=/some/absolute/path/where/junk/files/can/be/created/and/deleted
then
./cvsbug.sh 2>&1 | less

I hope the script can be used as the basis for a new test in the test suite.

Script follows:
-------------------------
#!/bin/sh
echo ${TMP}
rm -rf ${TMP}/cvstest
mkdir ${TMP}/cvstest
cd ${TMP}/cvstest
export CVSROOT=:local:${TMP}/cvstest/repos
cvs init
mkdir test
cd test
echo file1 >file1
cvs import -m "import" test import rel1
cd ..
rm -rf test
cvs co test
cd test
cvs tag -b branch1
echo file2 >file2
echo -----------------------------------------
cvs -n update
cvs diff
cvs status
echo Notice above commands listed file2 as new
echo -----------------------------------------
cd ..
echo N | cvs release -d test
echo .
echo notice that it saw file2
echo -----------------------------------------
cd test
cvs add file2
cvs commit -m "Added file2 to trunk"
cd ..
echo Y | cvs release -d test
echo .
cvs co test
cd test
echo -----------------------------------------
cat file2
echo notice that file2 exists
echo -----------------------------------------
cd ..
echo Y | cvs release -d test
echo .
cvs co -r branch1 test
cd test
echo file2 on branch1 >file2
echo -----------------------------------------
cvs -n update
cvs diff
cvs status
cvs commit -m "Added file2 to branch1 (I think)"
echo Notice above commands FORGOT file2
echo -----------------------------------------
cd ..
echo Y | cvs release -d test
echo .
echo notice above command reported no files changed
echo -----------------------------------------
cvs co -r branch1 test
cd test
echo -----------------------------------------
cat file2
echo notice that file2 WAS LOST BY CVS!!!!!!!!!!!!!!
echo -----------------------------------------
echo file2 on branch1 rewritten after data loss >file2
cvs add file2
echo -----------------------------------------
cvs -n update
cvs diff
cvs status
cvs commit -m "Added file2 to branch1 (again!)"
echo Notice above commands saw file2
echo -----------------------------------------
cvs -n update
cvs diff
cvs status
cd ..
echo Y | cvs release -d test
echo .
echo Notice above commands said the same as when file2 was lost
echo -----------------------------------------
cvs co -r branch1 test
cd test
echo -----------------------------------------
cat file2
echo notice that file2 was committed this time
echo -----------------------------------------
cd ..
echo Y | cvs release -d test
echo .
cd ..
-------------------------


Jakob Bøhm            mailto:jb@danware.dk
M.Sc.Eng.             http://www.danware.com
Danware Data A/S      phone: +45 45 90 25 25
Kongevejen 62         fax:   +45 45 90 25 26
DK-3460 Birkerod

Information in this e-mail does not constitute a binding
commitment on behalf of me or Danware Data A/S.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]