Software Infrastructure : Adding code to CVS Repository with WinCVS GUI This page last changed on Jun 25, 2008 by salamy. ## ## Standard method of operation for working with the CVS GUI clients ###### Creating a project: Due to the need for proper organization of files and file permissions, ALL projects (not including subdirectories) in the CVS repository on moonjelly are to be set-up by the repository administrator (Karen Salamy: salamy@mbari.org). Set-up involves creating project groups to restrict unauthorized users from editing or destroying files. New repository projects (modules) are generally set-up at the request of project managers, although any person who wishes to use the repository can make a request for a new project. To have a project (module) created, please e-mail the desired project name and list of users who will need access to the CVS administrator (salamy@mbari.org). Examples of previous projects are tiburon, isi, nmc. Checking out a module: To check out a module (project or folder) in the repository, click Create on main menu then click Checkout Module.... In the checkout module section, type in the module name you will be working with (no need to indicate /home/cvs). If this is a new project with no previous files in it or if you wish to check out all files in a project, check out the project (e.g., new project name "toolsled" - type in the word toolsled). If you desire a particular subdirectory already created in a project enter the following (projectname/subdirectoryname), OR, to checkout an ndividual file from that project, enter (projectname/subdirectoryname/filename). The latter will checkout the one file and all listed subdirectories. Be sure to set your home directory before checking files out as the default is to place all files on your computer's hard drive. If this works, you should see the GUI display folders and files checked out. Folders will be in orange, while files will be shown in green. Note: If you plan to work on files in your home directory that you already checked out previously, it is a good idea to first update the copy with the most recent version in the CVS repository. This is important as the file may have been edited by another group user since you last worked on it. To Update a project, folder or file in your home directory, simply click on the directory item and then on the menu bar click Modify - Update Selection. You may also click on the user interface button (white rectangle with a downward pointing green arrow). The WinCVS command line will show file and folder updates. Adding files to a project. In CVS, users edit and create new files in their home directory (a.k.a. a working directory or sandbox). To set up your home directory see: Seeting up a CVS GUI To add a new file to a directory, follow these steps: Step 1: You must first have a working copy of the directory. Step 2: Create the new file(s) inside your checked-out working copy of the directory. Step 3: In WinCVS, use the explore window (usually in left upper corner of screen) to browse to your home directory and view the new file(s) you have added. Click the new file(s) with your mouse and add the file(s) by either: 1) Clicking on menu bar Modify - Add Selection. If the file contains binary data click Modify - Add Selection Binary OR 2) Clicking on the user interface button (white rectangle with a red "plus" sign on it). If the file is a binary, click the binary add button which is white with a red "plus" sign and 01 on it.
    NOTE: (Holding the shift key down allows the addition of more than one file at a time).
Step 4: Commit the selection. This step actually "Adds" (checks-in) the file(s) to the repository. This can either be done with the file menu or with the user interface button. 1) Clicking on menu bar Modify - Commit Selection OR 2) Clicking on the user interface button (white rectangle with a red arrow pointing left on it).
    NOTE: (Holding the shift key down allows the addition of more than one file at a time).
You can also add new directories to a project. However, you must first add the directory in a separate step before adding any files to it. Unlike other CVS commands, the add options are not recursive. Removing files from a project. To remove a file, but remain able to retrieve old revisions follow these steps: Step 1: Make sure that you have not made any uncommitted modifications to the file. This can be done by using the diff command. You can also use the status or update commands. If you remove the file without committing your changes, you will not be able to retrieve the file as it was immediately before you deleted it. Step 2: Remove the file from your working copy of the directory. This can done by first highlighting the file and then clicking the main menu item Modify - Remove Selection. Step 3: Indicate to CVS that you want to delete the file. This can done in WinCVS by first highlighting the file and then clicking the main menu item Modify - Remove Selection. CVS should then highlight the file in red. Step 4: Remove the file from the repository. Click the commit GUI button or click on menu bar Modify - Commit Selection. When you commit the removal of the file, CVS records the fact that the file no longer exists. It is possible for a file to exist on only some branches and not on others, or to re-add another file with the same name later. CVS will correctly create or not create the file, based on the revision number or date options specified during checkout or update. NOTE: When you remove a file, it is removed only on the branch that you are working on. You can later merge the removals to another branch if you want. You can also remove directories from a project. The concept of removing directories is similar to removing files - you want the directory to not exist in your current working directories, but you also want to be able to retrieve old releases in which the directory existed. The way that you remove a directory is to remove all files in it. You do not remove the directory itself; there is no way to do that. Instead you specify the "prune empty directories" option to and update or checkout. This will cause CVS to remove empty directories from working directories. Probably the best way to do this is to always specify "prune empty directories". If you want and empty directory then put a dummy file (e.g., '.keepme') in it to prevent the "prune empty directories" option from removing it. It is best to become familiar with the WinCVS GUI and its checkout options before working in the repository. WinCVS has a "Help" menu that is useful. For more in-depth information, go to the CVS main web page http://www.cvshome.org/ and download the CVS manual.

Document generated by Confluence on Feb 04, 2026 09:02