Table of Contents
Because renaming files and moving them between directories is somewhat inconvenient, the first thing you do when you start a new project should be to think through your file organization. It is not impossible to rename or move files, but it does increase the potential for confusion and cvsnt does have some quirks particularly in the area of renaming directories. the section called “Moving and renaming files”.
What to do next depends on the situation at hand.
The first step is to create the files inside the repository. This can be done in a couple of different ways.
When you begin using cvsnt, you will probably already
have several projects that can be put under cvsnt control. In these
cases the easiest way is to use the import command.
An example is probably the easiest way to explain how to use it. If
the files you want to install in cvsnt reside in
wdir, and you want them to
appear in the repository as
rdir, you can
wdir$ cvs import -m "Imported sources" yoyodyne/
Unless you supply a log message with the -m flag, cvsnt starts an editor and prompts for a message. The string yoyo is a vendor tag, and start is a release tag. They may fill no purpose in this context, but since cvsnt requires them they must be present. Chapter 14, Tracking third-party sources, for more information about them.
You can now verify that it worked, and remove your original source directory.
$ cd .. $ cvs checkout yoyodyne/
rdir# Explanation below $ diff -r
rdir$ rm -r
Erasing the original sources is a good idea, to make sure that
you do not accidentally edit them in
bypassing cvsnt. Of course, it would be wise to make sure that you
have a backup of the sources before you remove them.
The checkout command can either take a module name as argument (as it has done in all previous examples) or a path name relative to $CVSROOT, as it did in the example above.
It is a good idea to check that the permissions cvsnt sets on the directories inside $CVSROOT are reasonable, and that they belong to the proper groups. the section called “File permissions”.
If some of the files you want to import are binary, you may want to use the wrappers features to specify which files are binary and which are not. the section called “The cvswrappers file”.
If you have a project which you are maintaining with another version control system, such as rcs, you may wish to put the files from that project into cvsnt, and preserve the revision history of the files.
If you have been using rcs, find the rcs files--usually a file named foo.c will have its rcs file in rcs/foo.c,v (but it could be other places; consult the rcs documentation for details). Then create the appropriate directories in cvsnt if they do not already exist. Then copy the files into the appropriate directories in the cvsnt repository (the name in the repository must be the name of the source file with ,v added; the files go directly in the appropriate directory of the repository, not in an rcs subdirectory). This is one of the few times when it is a good idea to access the cvsnt repository directly, rather than using cvsnt commands. Then you are ready to check out a new working directory.
The rcs file should not be locked when you move it into cvsnt; if it is, cvsnt will have trouble letting you operate on it.
Many version control systems have the ability to export rcs files in the standard format. If yours does, export the rcs files and then follow the above instructions.
Failing that, probably your best bet is to write a script that will check out the files one revision at a time using the command line interface to the other system, and then check the revisions into cvsnt. The sccs2rcs script mentioned below may be a useful example to follow.
There is a script in the contrib directory of the cvsnt source distribution called sccs2rcs which converts sccs files to rcs files. Note: you must run it on a machine which has both sccs and rcs installed, and like everything else in contrib it is unsupported (your mileage may vary).
There is a script in the contrib directory of the cvsnt source distribution called pvcs_to_rcs which converts pvcs archives to rcs files. You must run it on a machine which has both pvcs and rcs installed, and like everything else in contrib it is unsupported (your mileage may vary). See the comments in the script for details.
For a new project, the easiest thing to do is probably to create an empty directory structure, like this:
$ mkdir tc $ mkdir tc/man $ mkdir tc/testing
After that, you use the import command to create the corresponding (empty) directory structure inside the repository:
$ cd tc $ cvs import -m "Created directory structure" yoyodyne/
Then, use add to add files (and new directories) as they appear.
Check that the permissions cvsnt sets on the directories inside $CVSROOT are reasonable.