USING A VERSION-CONTROL SYSTEM (VCS)

4.6 USING A VERSION-CONTROL SYSTEM (VCS)

If you want to use a version-control system when developing your application code, you may now do so in MPLAB IDE using Projects.

• Select Project>Version-Control to set up the version-control application for use with MPLAB IDE. (See Section 9.25 “Version-Control Dialog”)

Note: Folders/files must already exist in the VCS for MPLAB IDE to use them in

a project.

To save an entire project (and workspace) in the VCS: • Outside of MPLAB IDE, check in the entire project. When you next check it out

and open it in MPLAB IDE, VCS-specific information will be available in the MPLAB IDE (see below.)

 2005 Microchip Technology Inc.

DS51519A-page 65

MPLAB ® IDE User’s Guide

To save only some project files in the VCS: • If you have common files contained in the VCS that you want to use in a specific

project, you will need to check out those files outside of MPLAB IDE. • Add the checked-out files to your project. You should now see VCS-specific

information in the MPLAB IDE (see below.) Once your project is set up for a VCS, you should notice the following changes to

MPLAB IDE: • The Project window will show version-control information for the project files, i.e.,

display check-out status. • Version-control commands for VCS files may be selected by right-clicking on a file

in the project window. • You may set up refresh options in the Project-Display Preferences Dialog, so you

can be aware of file check-in/check-out status. • The output window will contain a Version Control tab displaying activity between

MPLAB IDE and the version-control system. Additional information on using version-control systems currently supported is listed

below.

4.6.1 Microsoft Visual Source Safe

Having some knowledge of VSS and MPLAB IDE is necessary to use VSS from within MPLAB IDE.

For more information on this version-control system, please see the related web site. • Microsoft Visual Source Safe: http://www.microsoft.com Certain VSS files are required to be available locally (on your PC) for VSS to work with

MPLAB IDE. If you are using VSS on a network drive, you will need to run NETSETUP.EXE to install the proper files on your PC.

4.6.2 PVCS

Having some knowledge of PVCS and MPLAB IDE is necessary to use PVCS from within MPLAB IDE.

For more information on this version-control system, please see the related web site. • PVCS: http://www.merant.com/Products/ECM/VM/home.asp

4.6.3 CVS

Having some knowledge of CVS and MPLAB IDE is necessary to use CVS from within MPLAB IDE.

For more information on this version-control system, please see the related web site. • CVS: https://www.cvshome.org

4.6.3.1 IMPORTING FILES If your source files aren't already in the repository, you will have to import them to get

started. This creates the directory structure in the repository and places all of the files there as well.

CAUTION

Do not place the workspace (MCW) or build-state (MCS) files on the repository. MPLAB IDE needs to be able to write to these files while running.

DS51519A-page 66

 2005 Microchip Technology Inc.

Projects and Workspaces

An example of an import command is given below. The -d argument is not given, the assumption being that you have assiged the appropriate value to the CVSROOT environment variable. You want to be inside of the very top directory of your source tree when you give this command. The command will automatically recurse into subdirectories.

$ cd TopOfSrcTree $ cvs import -m “message” DirWithinCVSRoot VendorTag ReleaseTag

4.6.3.2 CHECKING OUT FILES Even if you have your source files locally, you will have to perform a cvs checkout

once (first-time use) before you can check out files from CVS in MPLAB IDE. This checkout creates the management files that CVS requires to perform commands on various files. All of these management files are stored in a hidden subdirectory of each directory in the source tree. Each of these hidden subdirectories is called CVS.

Trying to do a checkout overtop of existing source files without these supporting CVS directories will cause CVS to complain. You should either delete or move away the local copy of the sources before performing the checkout.

An example of performing the checkout is listed below: $ cd DirABOVEWhereIWantMySrcTree

$ cvs checkout MyProject cvs server: Updating MyProject U MyProject/main.c U MyProject/such-and-such-a-file.c U MyProject/foo.h

It is important that you give this command from above the directory where you want your source tree to reside, because CVS will actually create the entire source tree within the current working directory.

4.6.3.3 ADDING A NEW DIRECTORY You can use the cvs add command from within MPLAB IDE to add new source files

as long as the required directory structure already exists in the repository. The add command will NOT work on a file if any of the required directories don't exist in the repository.

To create the directory structure in the repository, you must use the cvs import command once again. An example of this is as follows:

$ cd TopOfSrcTree $ cvs import -m "message" MyProject/NewSubDir VendorTag ReleaseTag N MyProject/NewSubDir/yet-another-file.h

No conflicts created by this import Once again, you should give this command from within the directory that is the top-level

directory of your source tree. But this time, when you specify the directory within the repository, you should give the path in the repository that will represent the new directory that you are adding. (That is what MyProject/NewSubDir represents in this example.)

 2005 Microchip Technology Inc.

DS51519A-page 67

MPLAB ® IDE User’s Guide