WinCVS Tutorial (Part II)

 


For introductory information about WinCVS, take a look at WinCVS Tutorial (Part I) or at one of the references listed at the end of this document.

 

Setting the work area root folder 11

Changing Default Viewer Used to Open Programs  18

Using external diff program with graph mode  24

Watching files  48

Tagging files  57

Branching  60

References  64

 

Setting the work area root folder

When you run CVS, you see the main browser window. You might want to change your settings so that only the work area root folder with its checked-out modules is visible. This can be done by choosing View->Browse Location->Change… from the menu. A dialog box pops up where you can specify which folder you want as your work area root folder.

 

 

 

Top

Changing Default Viewer Used to Open Programs

WinCvs uses the default viewer when you double click a file in the browser that has no default Windows file-type association. You can change the default viewer to one of your choice. You might consider using gvim. Gvim is an improved vi editor with a graphical user interface. For a tutorial on gvim (installation and commands) click here. In order to change the default viewer used to open programs choose Admin->Preferences… from the menu and go to the WinCvs tab. Click on the button and choose the executable for the file editor.

 

 

 

Top

Using external diff program with graph mode

WinCvs may be used for viewing status, logs, diffs etc, of files and directories (for more information see section Viewing changes). If you want to use a graphical diff program, download one and install it one your machine, if you don’t have one already. (You can use WinDiff, VisualDiff, ExamDiff or any one of a number of file comparison utilities available. Click here to find some freeware file comparison programs.)

 

Choose Admin->Preferences… from the menu and go to the WinCvs tab. Check the “External diff program:” box and use the browse button to locate your favorite graphical diff program.

 

 

 

As described in the Viewing changes section, you can view changes made between two different versions of a file. Here we describe how to use the external diff program to do that.

 

Select the file you want to investigate and choose Query->Graph selection from the menu. You can also achieve this by right clicking on the file and choosing Graph selection from the popup menu.

 

 

 

Shift-click on the two revisions you want to compare and choose Graph->Diff selected from the menu. Your favorite diff program (specified as the external diff program as outlined above) appears with the results of the diff.

 

 

 

The same effect can be achieved while using the Query->Diff selection option, if you check the Use the external diff box in the dialog box that pops up.

 

 

Top

Watching files

High contention files can be watched for edits.  This scheme follows a publish/subscribe model.  When someone intends to change a file, she initiates the "edit" command that notifies the developers that have set up "watches" for it.  Watch notifications are sent via email.  Notifications are also sent when watched files are committed.

 

To set up a watch on a file, select the file and choose Trace->Add a watch on selection from the menu.

 

 

 

This option doesn’t seem to work as expected; there is no provision for sending/receiving e-mails. In effect, it works no different than Editors of selection option. To determine the people who have a watch on a given selection, choose Trace->Watchers of selection from the menu. The list of watchers is displayed as output.

 

Top

Tagging files

The basic mechanism for maintaining multiple releases of a product using cvs is the tag. When a product has been tested and ready for release with a given set of file revisions, the files can then be tagged with a symbolic name. Files may be modified after the release but the tagged version can always be retrieved.

 

Tags may be created by module or on a selection of directories, files or file.

 

To create a tag by module choose Create->Create a tag by module… To create a tag by selection choose Modify->Create a tag on selection… The following dialog box pops up.

 

 

The Create tag settings panel provides a field to enter the tag name and three options. The tag name may not contain any of the following characters: $, . : ; @.

The Overwrite existing tags with the same name option specifies that any existing tags found with the same name should be moved to the version in the current work area.

The Do not recurse into sub-directories option may be useful in cases where a snapshot of a single folder is desired.

It is probably a good idea to use the Check that the files are unmodified before tagging option since it does not make much sense to have files in your release work area that are modified but not committed.

 

Tags can be deleted by choosing Create->Delete a tag by module… and Modify->Delete a tag on selection…

 

Top

Branching

The problem that always comes up in release management is what to do when a bug is found after a product version has been released. Presumably, the files in the repository have been modified since the release and are not likely to be stable enough to be included in a bug fix release. The solution to this problem is to create a branch from the version of the repository tagged at release time. Files can then be modified in the branch without interfering with continuing development on the trunk. After the fixes have been verified, the original release tag can be moved to the new file revisions or a new release tag can be created.

 

The files in a work area updated to a tagged release cannot be modified and committed back to the repository. To make modifications to files, you need to be updated to a branch.

 

A branch can be created by module by choosing Create->Create a branch by module… or on a selection by choosing Modify->Create a branch on selection… from the menu. The following dialog box pops up.

 

 

 

Enter the desired name for the branch and hit the OK button. It is a good idea to give the branch a name that clearly indicates its purpose. It is often useful to set the Do not recurse option also since it is common to branch a single folder and not need branches in the sub-folders (the default).

 

Top

 

References

You might find the following resources helpful, if you run into any questions/problems while using WinCVS.

 

1.      WinCVS Daily Use Guide. http://www.computas.com/pub/wincvs-howto/ (Excellent reference material with helpful tips for basic functions)

2.      WinCvs Version 1.1 User Guide. http://www.wincvs.org/winhtml/wincvs11.htm (Step by step guide for every function available)

3.      WinCVS QuickStart for Novices. Manik Surtani. http://silkroad.co.uk/help/help.php3 (As the title suggests….a quick start)

4.      CVS and WinCVS QuickStart Guide. http://devguy.com/fp/cfgmgmt/cvs/startup/  (Step-by step instructions with nice pics)

5.      CVS Information manual. http://www.cvshome.org/docs/manual/cvs.html (How to use and administer CVS)

 

Top