Next Up Previous Contents
Next: 3 Building applications and libraries
Up: 2.7 CVS
Previous: 2.7.1 CVS and tagging
[ID index][Keyword index]

2.7.2 CVS and recursion -- checking out only a subtree

There are two traps in the way that CVS recurses into subdirectories. The first is that if a subdirectory is present in the repository but not in your checkout (most commonly because it has been recently added to the repository by someone else), then CVS will not by default add that subdirectory when you do an update, and will give no indication that it is there. It is not clear to me why this is a sensible default, but it is the case nonetheless. Only if the -d option is present on the cvs update command will the `missing' directory appear.

The other `trap' is that CVS does recurse by default when you do a checkout. This is almost always the right thing, but it can be inconvenient when you want just the top level of the repository. If you wanted to check out only the top level, or only the buildsupport tools, then the command cvs -d ??? checkout . would not be the right thing, since it would check out the top level and everything underneath it. A better set of commands would be


cvs -d username@cvs.starlink.ac.uk:/cvs co -l .
cvs -d username@cvs.starlink.ac.uk:/cvs co buildsupport
cvs -d username@cvs.starlink.ac.uk:/cvs co thirdparty/fsf
The first line checks out the top level directory but, because of the -l (`local') flag, does not recurse and check out the complete repository. The following lines check out particular directories, usefully recursing into their children.

If you want to check out just the applications directory, but none of its children, use


cvs -d username@cvs.starlink.ac.uk:/cvs co -l applications
while in the top-level directory. Don't do ... co -l . in the applications directory -- you'll get the top-level directory again.


Next Up Previous Contents
Next: 3 Building applications and libraries
Up: 2.7 CVS
Previous: 2.7.1 CVS and tagging
[ID index][Keyword index]
The Starlink Build System
Starlink System Note 78
Norman Gray, Peter W Draper, Mark B Taylor, Steven E Rankin
11 April 2005. Release snapshot: $Revision: 1.116 $. Last updated 28 May 2006