info-cvs
[Top][All Lists]
Advanced

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

Re: Request for Help: Bulk adding new files to a branch


From: Wim Kerkhoff
Subject: Re: Request for Help: Bulk adding new files to a branch
Date: Wed, 06 Mar 2002 22:32:11 -0800

Rob Helmer wrote:
> 
> On Wed, Mar 06, 2002 at 04:54:53PM -0800, Terry Spafford wrote:
> >
> > 1. Create a branch with the name I want off of the Trunk filled with the
> > current code.
> > 2. Check out that new branch.
> > 3. Clear out the current code from that branch, leaving the CVS directories.
> > 4. Copy over the old code that we wanted.
> > 5. Go throuhg and do a CVS Remove for any files that were in the Trunk
> > but not the branch. (TEDIOUS!)
> > 6. Do a CVS add for any files in the branch but not in the Trunk (also
> > Tedious)
> > 7. Commit all the files under the new branchname, making sure that no
> > merging is done.
> 
> Well, it's only tedious if you do all the work yourself, why
> not let the computer handle it?
> 
> Assuming you haven't created directories named CVS ( which you
> shouldn't, CVS won't work ) or any files with the word CVS in them, why not :
> 
> cvs tag -b branch_name
> cvs update -r branch_name
> cvs rm -f `find ./ | grep -v "CVS"`
> cvs commit -m "cleaning up branch"
> cp -rp /newfiles/* .
> cvs add `find ./ | grep -v "CVS"`
> cvs commit -m "populating branch for customer"

Wouldn't you want to do something like this?  This should be somewhat
cleaner, as you aren't removing, then readding any files. It only gets
removed if it isn't in the customer branch. This should be nicer on your
repository, or not?


# create branch
cvs tag -b branch_name
cvs update -r branch_name

# remove all local files (don't touch CVS yet)
rm -f `find . -type f | grep -v CVS`

# reinsert the new files
cp -rp /newfiles/* .

# do an add, in case some of the files from the customer branch
# are new and did not exist in the head branch before
cvs add `find . | grep -v CVS`

# tell CVS to remove files that are not in the customer branch
cvs rm

# commit all the new files, the changed files, 
# and the removed files
cvs commit -m "populating branch for customer"

##################################

Wim



reply via email to

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