bug-cvs
[Top][All Lists]
Advanced

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

Re: [BUG] two update -j -j 's leave a file in the Attic


From: Eli Carter
Subject: Re: [BUG] two update -j -j 's leave a file in the Attic
Date: Wed, 31 Oct 2001 12:19:44 -0600

Eli Carter wrote:
> Hmmm.. ok, I can reproduce this without involving a branch... I'll
> follow up with that test case.

1.1 normal commit
1.2 normal commit
1.3 cvs remove and commit

Broken method:
cvs update -j1.3 -j1.2
cvs update -j1.2 -j1.1
cvs commit
This leaves the 1.4 'Exp' file in the Attic where checkout won't find
it.

Working method:
cvs update -j1.3 -j1.1 and commit
The 1.4 version is fine.

Also note the comments at the end of the attached test script.

Questions, comments, etc?

Eli 
--------------------.     Real Users find the one combination of bizarre
Eli Carter           \ input values that shuts down the system for days.
eli.carter(a)inet.com `-------------------------------------------------
#!/bin/sh
# This script demonstrates a bug in CVS
#
#   1.1
#    |
#    |
#    |
#    V
#   1.2
#    |
# remove
#    |
#    V
#   1.3
#    |
# commit of merge
#    |
#    V
#   1.4
#
# if the merge is done as
# cvs update -j1.3 -j1.2
# cvs update -j1.2 -j1.1
# the file is Exp and in the attic
# if the merge is done as
# cvs update -j1.3 -j1.1
# the file is correct

CVSROOT=`pwd`/testroot

thefile=somefilename

cvs init
mkdir project
cd project
cvs import -m 'initial checking of project, empty' project vendortag releasetag
cd ..
cvs checkout project
cd project

# add $thefile to the project
echo "initial content" > $thefile
cvs add $thefile
cvs commit -m 'version 1' $thefile

# modify $thefile
echo "work, work, work" >> $thefile
cvs commit -m 'version 2' $thefile

# remove $the file from the project
rm $thefile
cvs remove $thefile
cvs commit -m 'remove version 2' $thefile

# revert the file to version 1
if true
then
    # this leaves an 'Exp' file in the Attic,
    cvs update -j1.3 -j1.2 $thefile    # revert the cvs remove
    cvs update -j1.2 -j1.1 $thefile    # revert the work
    message='revert to version 1.1 in two steps'
else
    # but this does not.
    cvs update -j1.3 -j1.1 $thefile
    message='revert to version 1.1'
fi
cvs commit -m "$message" $thefile

# For the two update path, $thefile now has the Exp state and is in the Attic.
# It will not be found by the checkout command.
# Also, if you do the commit with an interactive message (vi session), it will
# list $thefile as Modified, but for the one update path it lists it as Added.

reply via email to

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