Home TOC Previous 


                   8.3  How Do I...

                               8.3.1  Configure CVS Environment Variables

 

 

 

 

Click Project->Project Setup, select Source Control property sheet.

Using a local repository:

Fill the root directory path-name of the master source repository in the Repository Location edit box. This value should be specified as an absolute path-name.

Select Local CVS Server in the group box.

Using a remote repository:

Fill the root directory path-name of the master source repository in the Repository Location edit box. This value should be specified as an absolute path-name.

Select Remote CVS Server in the group box.

Fill the IP address or host name in the Remote Server Address edit box.

Fill the username and password in the CVS username edit box and password edit box.

Verify the connect string which automatically generated by these properties.

Test:

Press the Test button to test the CVS connection.

                               8.3.2  Importing your sources for the first time

 

 

 

Add an entire project to CVS repository

You can add a project to the CVS repository any time after you have created it.

To add a project to the CVS repository

1.     Select an existing project in the FileView pane.

2.     From the Project menu, choose CVS, and from the drop-down menu, choose Add To CVS Repository.

The Add to CVS Repository dialog appears, requesting CVS project information.

You can change the directory of your CVS repository in the edit box and click View to view existing projects in this CVS repository .

If you use remote CVS server , click Advanced , the repository setup dialog appears, you can setup remote CVS server in this dialog.

NOTE: Although Magic C++ provides the CVS project import function, it is recommended to import the project to CVS repository manually at command line for more flexibility:

Import Project to CVS Repository by Command Line.

                               8.3.3  Checking out sources

 

 

 

Checkout a project from CVS repository

You can checkout a copy of project in CVS repository to your working directory.

To check out a project from CVS repository

Select an existing project in the FileView pane

From the Project menu, choose CVS , and from the drop-down menu , choose Check Out from CVS Repository.

You can change the directory of your CVS repository in the edit box and click View to view existing projects in this CVS repository .

Select one of existing projects , and click Checkout ,

The file select dialog appears , the File list include any files in the CVS project . you can select one or more files add to your Magic C++ project.

NOTE: Although Magic C++ provided the CVS project checkout function, it is recommended to use command line to checkout your project from CVS repository for more flexibility:

Checkout Proejct from CVS Repository by Command Line.

                               8.3.4  Updating your sources

 

 

To Update files from CVS repository

1       In the FileView pane of the Project Workspace window, select the files that you want to check out.

2       From the Project menu, choose CVS, and from the drop-down menu, choose Update from CVS.

                               8.3.5  Committing your changes

 

 

To Commit Files to CVS repository

1       In the FileView pane of the Project Workspace window, select the files that you want to check out.

2       From the Project menu, choose CVS, and from the drop-down menu, choose Commit to CVS.

3       Type a comment in the Comment text box.

4       Click OK.

                               8.3.6  Adding and removing source files

 

 

The source tree is constantly changing and there is often the need to add new files and delete existing files within the directory tree.

Add individual files to CVS repository

1      In the FileView pane of the Project Workspace window, select the files that you want to put under CVS repository.

2      From the Project menu, choose CVS, and then choose Add To CVS Repository from the drop-down menu.

3      The Add To CVS Repository dialog box appears, with checks in the Files list next to the files that you have selected. The list includes all files in the project directory that are not already under CVS, and you may check or uncheck any files in the list.

Removing Files from CVS Repository

In the FileView pane of the Project Workspace window, select the files that you want to remove from source-code control.

1.     From the Project menu, choose CVS, and from the drop-down menu, choose Remove From CVS Repository.

2      The Remove From CVS Repository dialog box appears, with checks in the Files list next to the files that you have selected. You may check or uncheck any files in the list.

3     Click OK.

                               8.3.7  Tagging sources for symbolic revisions

 

 

 

To create a snapshot of the current sources for later use, you can tag sources to generate a symbolic tag that is bound to each of the current revisions in your local copy of the project.

1       In the FileView pane of the Project Workspace window, select the file or files for which you want a history.

2       From the Project menu, choose CVS, and then choose Add Tag on Filesˇ­from the drop-down menu.

3       The File Select dialog box appears, with checks in the Files list next to the files that you have selected, and you may check or uncheck any files in the list.

5       Type a comment in the Comment text box.

6       Click OK

                               8.3.8  Comparing File Between CVS Repository and  Working Directory

 

 

 

You can compare a file in the CVS repository with the one in your working directory.

In the FileView pane of the Project Workspace window, select the file or files for which you want thehistory.

From the Project menu, choose CVS, and then choose Show File Differences from the drop-down menu.

                               8.3.9  Checking the status

Checking the current status

 

 

Each file in a project has a property page associated with it. The property page includes information about the file, including its current status in the cvs if it is under cvs repository.

Note If the file is not under cvs, no status information appears on the property page.

Select the file in the FileView pane of the Project Workspace window, and press ALT+ENTER.

-or-

Select the file in the FileView pane of the Project Workspace window, right click your mouse to display the shortcut menu, and choose Properties.

Checking all the logs

 

 

1       In the FileView pane of the Project Workspace window, select the file or files for which you want the history.

2       From the Project menu, choose CVS, and then choose Show File Historyˇ­ from the drop-down menu.

3       File History dialog appears, in this dialog, you can View an old version of the file , Get the snapshot of an old version , show Difference of two versions and Restore to trunk.

 n                            8.3.10  Additional CVS command line guide

The following is a step-by-step introduction to the usage of the import and checkout CVS commands. It is recommended that you read through and understand what is presented in the basic CVS manual first.

                               8.3.11  Import Project to CVS Repository by Command Line

For example:

To import a project,

go into the top-level directory of your project tree first:

floss$ cd myproj 
floss$ ls 
README.txt  a-subdir/   b-subdir/   hello.c 
floss$ 

This project has two files -- README.txt and hello.c -- in the top level, plus two subdirectories -- a-subdir and b-subdir -- plus some more files (not shown in the example)

The general syntax of an import command is :

floss$ cvs import -m "log msg" projname vendortag releasetag

The -m flag (for message) specifies a short message describing the import. This will be the first log message for the entire project; every commit command thereafter will also have its own log message. These messages are mandatory; if you don't give the -m flag, CVS automatically starts up an editor (by consulting the EDITOR environment variable) for you to type a log message in. After you save the log message and exit the editor, the import then continues.

The next argument is the project's name (we'll use "myproj"). This is the name under which you'll check out the project from the repository. (What actually happens is that a directory of that name gets created in the repository, but more on that in Repository Administration.) The name you choose now does not need to be the same as the name of the current directory, although in most cases it usually is.

The vendortag and releasetag arguments are a bit of bookkeeping for CVS. Don't worry about them now; it hardly matters what you use. For now, we'll use a username and "start" for those arguments.

We're ready to run import:

floss$ cvs import -m "initial import into CVS" myproj jrandom start

N myproj/hello.c

N myproj/README.txt

cvs import: Importing /usr/local/cvs/myproj/a-subdir

N myproj/a-subdir/whatever.c

cvs import: Importing /usr/local/cvs/myproj/a-subdir/subsubdir

N myproj/a-subdir/subsubdir/fish.c

cvs import: Importing /usr/local/cvs/myproj/b-subdir

N myproj/b-subdir/random.c

No conflicts created by this importfloss$

                               8.3.12  Checkout Proejct from CVS Repository by Command Line.

The command to check out a project is exactly what you think it is:

cvs checkout myproj

cvs checkout: Updating myproj 
U myproj/README.txt 
U myproj/hello.c 
cvs checkout: Updating myproj/a-subdir 
U myproj/a-subdir/whatever.c 
cvs checkout: Updating myproj/a-subdir/subsubdir 
U myproj/a-subdir/subsubdir/fish.c 
cvs checkout: Updating myproj/b-subdir 
U myproj/b-subdir/random.c

floss$ ls 
myproj/     
floss$ cd myproj 
floss$ ls 
CVS/        README.txt  a-subdir/   b-subdir/   hello.c 
floss$ 

This is your first working copy,then you can create a new blank Magic C++ project by using project wizard in graphical IDE, and input the Main Directory corresponding to the directory 'myproj' .i.e. /home/flose/myproj .

After you create a blank project, Add files to your Magic C++ project by using project->Add to project menu item, then you can see the cvs status in the fileview pane so you can commit ,update and check file history.


Home TOC Previous 

Copyright(c) 2003-2004 Magicunix,Inc.