Tuesday, July 10, 2007

CVS import

http://www.slac.stanford.edu/grp/cd/soft/cvs/cvs_cheatsheet.html

cvsimport The way you create a new directory or tree of directories in
CVS.
You use a cvs import command when you want to add a whole directory to
CVS. CVS import is not used to add a bunch of files to an existing
directory - for that use "cvs add" (see above). Before getting into the
command itself, first pick a place in the existing cvs tree where you
want to add your stuff. For this example, let's say you wanted to add a
directory of "tool" files to cvs at the new directory "common/tool", so
its reference directory would be $CD_SOFT/ref/common/tool/. The argument
you would have to give to the cvs import command will be "common/tool".
The argument is always the full pathname, after the $CD_SOFT/cvs part,
of the root of the directory you want to create, even if some of the
intermediate directories already exist (in this case, "common/" already
exists).

cvs import always imports all the files, and all subdirectories, in the
working directoryfrom which it is being run. That is, it imports a
directory tree into the place specified by the argumetk. So, be careful
not to do something like cd to a directory which contains the root of a
directory tree which you want to import and then issue cvs import giving
as the argument the leaf-of-directory-tree you want to import, e.g. cd
~/work (containing common/tool) and then cvs import common/to.ol. That
would create $CD_SOFT/cvs/common/tool/common/tool/!! If you only want to
import a single directory, then the root and the leaf are the same
directory, so you can use a sequence of commands as in example 1) below.
But if you really want to import more than one directory, you have to
use a sequence like that in example 2.

Also be careful not to import a directory system that contains a
subdirectory that is itself the result of a CVS checkout, because that
subdirectory will contain a CVS subdirectory. This is very messy to
clean up. You shouldn't ever want to anyway, because cvs import must
always be run from the directory whose files you want to import, and
always takes the fully qualified cvs module name as the argument.

The two other arguments to cvs import are the "vendor tag", and the
"release" tag:

* "vendor tag" is a free form text string you're supposed to use
to identify the vendor of software. Since it's a CVS tag, it
should be all upper case and not have any special charatcters
save the "_" (like no "." or "-"). Our standard for this tag is
"CD_SOFT", when we're the vendors.
* "release tag", is also a free form text string you're supposed
to use to identify the release of the software you're putting in
CVS. For EPICS software, we use a release tag like "R3_13_6",
for all other software, for the initial release, we use "R1_0".

After you have done the cvs import, be sure to go to the corresponding
reference area and do the initial cvs checkout.

Eg


cvs import [options]
directory-name
vendor-tag release-tag


1


cd ~/work/common/tool

cvs import common/tool
CD_SOFT R1_0

cd $CD_SOFT/ref

cvs checkout common/tool


Say ~/work/common/tool
is the directory where
all the tool files are.
All the files in that
directory will be
imported (unless they're
in the CVSIGNORE set).

Imports all the files
from your working
directory, into
cvs/common/tool.

Creates the initial
checkout of the
directory you just
created in cvs.


2


cd ~/work

cvs import app/myapp
CD_SOFT R1_0

cd $CD_SOFT/ref

cvs checkout app/myapp


Say ~/work is the root
directory of where all
the files are of a new
application are. All the
files and all the
subdirectories in that
directory will be
imported into
cvs/app/myapp (unless
they're in the CVSIGNORE
set).

Imports all the files
from ~/work, into
cvs/app/myapp.


3


cvs import -m "initial
import" ... app/myapp
CD_SOFT R1_0


As above, but gave a
comment on the command
line rather than making
cvs start an editor and
asking for the comment
interactively.

Blog Archive