[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ignoring files known to CVS, when updating
From: |
Denniston, Todd A CIV NAVSURFWARCENDIV Crane, Code 6067 |
Subject: |
Re: Ignoring files known to CVS, when updating |
Date: |
Tue, 08 May 2007 15:29:38 -0500 |
User-agent: |
Thunderbird 1.5.0.10 (X11/20070221) |
Marc-André Boucher wrote:
Is there a way to ignore files that are already known to CVS? The problem is I
want to deploy my project to multiple servers/environments/sites, but I don't
want to override the configuration files every time I create my deployment
package.
I have a single directory with my project which I update using CVS, and
multiple directories with the configuration files of each of the
servers/environments/sites where I deploy.
I would like to run a single "cvs update" command to keep the project
up-to-date, but ignoring the config files so that I don't have to modify them
everytime they are committed in CVS.
I have modified them directly on the deployment server, and they merge
everytime I update the project, which is ok, but if the configuration files
are committed for some changes, I don't want them to merge : I'm gonna modify
them manually if I have to.
I know it seems like a software deployment problem, but the CVS part
is the heart of it. I have found other ways to do this, but they're too much
of a "patch" than a real solution!
Thanks again for your time. If there's a way to do this, that would spare me
some problems!
I think you can do this with the modules file.
What follows is a paste-able script to replicate what I did to prove it to
myself.
cd /tmp/
mkdir testme
cd testme/
mkdir repo
cvs -d /tmp/testme/repo/ init
mkdir repo/myroot
cvs -d /tmp/testme/repo/ checkout myroot
cd myroot/
mkdir dir1
mkdir dir2
mkdir dir3
for i in `seq 1 5`;do date > dir1/common$i;done
for i in `seq 1 5`;do date > dir2/com$i;done
for i in `seq 1 5`;do date > dir3/specific$i;done
cvs add dir*
cvs add dir*/*
cvs commit -m "dont ask"
cd ..
cvs -d /tmp/testme/repo/ checkout CVSROOT
#make the following mod.
--- CVSROOT/modules 8 May 2007 10:08:43 -0000 1.1
+++ CVSROOT/modules 8 May 2007 20:09:18 -0000 1.2
@@ -24,3 +24,6 @@
# character to interpose another module into the current module. This
# can be useful for creating a module that consists of many directories
# spread out over the entire source repository.
+
+specific2 -a myroot/dir1 myroot/dir2 myroot/dir3/specific2
+
cvs commit -m "dont ask" CVSROOT/modules
mkdir codir
cd codir/
cvs -d /tmp/testme/repo/ checkout specific2
for i in `seq 1 5`;do date >> \
/tmp/testme/myroot/dir3/specific$i ;done
cvs commit -m "dont ask" /tmp/testme/myroot/dir3/
cd myroot/dir3/
cvs update
ls -ltrh ;echo "should only see specific2"
IIRC the reason this works is the CVS/Entries file in dir3 only contains the
entry for specific2 and so it does not look for others unless you update with
the '-d' option.
BTW, using the -a was not obvious to me until I understood that it is telling
cvs to replace the module name on the command line with exactly what comes
after the module name in the modules file ... i.e.
specific2 -a myroot/dir1 myroot/dir2 myroot/dir3/specific2
is not the same thing as
specific2 myroot/dir1 myroot/dir2 myroot/dir3/specific2
and I don't understand why.
if you don't want to create the modules file you could do (at the checkout
place in the script after I indicate mod the modules file):
cvs -d /tmp/testme/repo/ checkout \
myroot/dir1 myroot/dir2 \
myroot/dir3/specific2
--
Todd Denniston
Crane Division, Naval Surface Warfare Center (NSWC Crane)
Harnessing the Power of Technology for the Warfighter
- Ignoring files known to CVS, when updating, Marc-André Boucher, 2007/05/08
- Re: Ignoring files known to CVS, when updating, Todd Denniston, 2007/05/08
- Re: Ignoring files known to CVS, when updating,
Denniston, Todd A CIV NAVSURFWARCENDIV Crane, Code 6067 <=
- Re: Ignoring files known to CVS, when updating, Spiro Trikaliotis, 2007/05/10