After successfully creating a CVS repository, it is time to start creating (importing) projects into the repository. Under CVS, a project is simply a collection of related files under a single directory.Creating the Initial Project Directory Structure
- I will be using the UNIX version of CVS (Release 1.11.14) on a Sun Solaris platform. For complete instructions on installing CVS for this platform, see "Installing CVS".
- We have a CVS repository located at: "/var/lib/cvsroot". For complete instructions on creating a CVS repository for UNIX, see "Creating a CVS Repository".
- For this example, we will be creating a dummy project named "ProjectX". It will consist of several blank files (just by using the touch) command.
Now let's create the initial project directory structure for our project (ProjectX). Put some thought initially into how you want the directory structure before importing into CVS. If, for example, you decide to move a set of files after they have been stored in CVS, CVS will now consider two versions of each file: the original set of files in their original location, and the second set of files in their new location. The history of those files are then split into two parts.Importing the Project Now finally, let's create our initial directory structure for ProjectX and import it into the repository:cvs [ -d repository_path_name ] import name_of_project vendor_tag release_tagLet's take some time to discuss the above parameters. If the CVS repository is on the local machine, then simply use the full path of the repository directory for the repository_path_name. That will be the case in this example. If the CVS repository is on a remote machine, see "Logging into CVS / Setting CVSROOT" for detailed instructions on setting the repository location. For the name of the project, we will be setting the parameter name_of_project to ProjectX. As for the vendor_tag and release_tag, I like to set vendor_tag = INITIAL and release_tag = start. These are the conventions used in JDeveloper from Oracle.
% cd /tmpAfter the running the cvs ... import ... (above), CVS will put you into an editor windows (probably vi). This is where you would enter any message to remind you of what the project is about.
% mkdir ProjectX
% touch ProjectX/File1.java
% touch ProjectX/File2.java
% touch ProjectX/File3.java
% cd ProjectX
% cvs import ProjectX INITIAL start
This is the initial import of ProjectX. If this were a real project, IAfter exiting from the editor, CVS will complete the import process as show below:
would consider putting the project specification document here.
CVS: ----------------------------------------------------------------------
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
CVS:
CVS: ----------------------------------------------------------------------
N ProjectX/File1.javaAfter importing a project, it is always a good idea to backup the repository (as well as your original directory structure for the project). After importing the project and backuping up the repository, you should remove the original directory structure that we imported since you cannot use it as a sandbox.
N ProjectX/File2.java
N ProjectX/File3.java
No conflicts created by this import
% cdAs a final step, you should verify that the project is in the CVS repository by checking it out in your work area (or sandbox area):
% rm -rf /tmp/ProjectX
% cd ~You can also perform a directory listing on the CVS repository:
% mkdir myWorkArea
% cd myWorkArea
% cvs co ProjectX
cvs checkout: Updating ProjectX
U ProjectX/File1.java
U ProjectX/File2.java
U ProjectX/File3.java
% ls -l /var/lib/cvsroot
total 4
drwxrwsr-x 3 cvs cvsdev 1024 Jan 23 19:30 CVSROOT/
drwxrwsr-x 2 oracle cvsdev 512 Jan 24 19:29 ProjectX/
% ls -l /var/lib/cvsroot/ProjectX
total 6
-r--r--r-- 1 oracle cvsdev 505 Jan 24 19:22 File1.java,v
-r--r--r-- 1 oracle cvsdev 505 Jan 24 19:22 File2.java,v
-r--r--r-- 1 oracle cvsdev 505 Jan 24 19:22 File3.java,v
No comments:
Post a Comment