-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lemke, Michael  IZ/HZA-IOP <[EMAIL PROTECTED]> writes:

> When I do a cvs import of a new vendor version the new files become the
> head revision.  I'd like to do the import such that it doesn't affect HEAD.
> Only after I've tested the new stuff I want it to become HEAD.  Of course,
> it should work with local changes merged in just like the standard way of
> doing it on the trunk.  How can I do this?  

A feature to deal with this was just added to the CVS feature branch
based on patches from "Chris G. Demetriou". It is the 'cvs import -X'
switch which may be enabled by default using the option
"ImportNewFilesToVendorBranchOnly=yes" in the CVSROOT/config file.
If you checkout the top-of-tree cvs.cvshome.org ccvs module, you can
have a version of CVS with this feature.

However, Chris also provided a proof of concept set of shell scripts to
help you in the short term.

See http://lists.gnu.org/archive/html/bug-cvs/2004-06/msg00173.html
and http://lists.gnu.org/archive/html/bug-cvs/2004-06/txt5G0hQtIjfA.txt

If you hae already done other imports in your tree, you will need/want
to force a commit of the HEAD to be exactly the same as the previously
imported versions for now so that the stuff that works will all still be
visible. This will change the default branch from the vendor 1.1.1 to
the HEAD again. If you only have 1.1.1.1 versions from a single previous
import, you could just use 'cvs admin -b1' on those files instead of
forcing a checkin in preparation for a new cvs import.

        Enjoy!
        -- Mark

       --------------- start of cvsimport_killnew ---------------
#!/bin/sh
# $Id: cvsimport_killnew,v 1.5 2003/01/16 01:27:55 cgd Exp $

# Script to kill revision 1.1 in files newly imported by CVS.
# See http://www.demetriou.com/~cgd/cvs for details.
#
# Written by Chris G. Demetriou <[EMAIL PROTECTED]>.  Public domain.

fatal() {
        echo '***' $0: ERROR: $1 1>&2
        exit 1
}

usage() {
        echo usage: $0 logfilename 1>&2
        fatal usage
        exit 1
}

if [ -z "${CVSROOT}" ]; then
        fatal "CVSROOT is unset"
fi

logfile=$1
if [ -z "$logfile" ]; then
        usage
fi
if [ ! -f "$logfile" ]; then
        fatal "$logfile does not exist"
fi

awk '/^N / { print $2 }' "$logfile" | (
        set -e
        while read file; do
                repos_path=${CVSROOT}/${file},v 
                repos_dir=`dirname ${repos_path}` 
                repos_file=`basename ${repos_path}` 

                if [ ! -f $repos_path ]; then
                        echo "Warning: $repos_path does not exist."
                        continue
                fi

                echo "Fixing $file..."
                (
                        # XXX error handling in this block is bogus...
                        # a dir that won't (likely) be used.
                        mkdir -p $repos_dir/CVS
                        cd $repos_dir/CVS

                        # reset default branch.
                        rcs -b ../${repos_file} 

                        # check in new rev w/ same contents.
                        co -l -M ../${repos_file}
                        ci -r1.2 -d -sdead \
                            -m"revision 1.1 was added on the vendor branch; delete 
from trunk" \
                            ../${repos_file}
                )
                rmdir $repos_dir/CVS || true

                echo "Moving $file to the attic..."
                mkdir -p ${repos_dir}/Attic 
                mv ${repos_path} ${repos_dir}/Attic/${repos_file} 
        done
)

exit
        --------------- end of cvsimport_killnew ---------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFA/9ot3x41pRYZE/gRAp8LAJ0ed5Ka5JFtHi2mxIGrjKFfsxni3ACghi01
OE240lCAnC7HNy0Lpct90s0=
=SrRT
-----END PGP SIGNATURE-----


_______________________________________________
Info-cvs mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/info-cvs

Reply via email to