CVS CVS • • Concurrent versions system • Works on project level • Network support • Multiple developers working in their own environments • Stores differences between releases (except binary files) Concurrent Versions System 1 TDDB64 1 4 TDDB64 4 Versioning Systems CVS Terminology • • Object – any “file” under CVS control • Module – identifier for a collection of objects • Version – version number of the object • Tag – common id of all “current” objects in a module • Branch – split in the version tree • Repository – where the files are stored/archived Have you ever experienced this mess? 2 TDDB64 2 5 TDDB64 5 Software Configuration Management The Repository • Managing releases of source code • Stores complete copy • Development with multiple developers • Retrieve source code for previous releases • You copy files to working directory • Tracking changes over releases • Several developers can Under version control Checkout the same files Local and remote access to repositories 3 TDDB64 3 6 TDDB64 6 1 Initializing the Repository • Deleting Files Set up the environment • setenv CVSROOT /home/kalle123/cvsstuff/ • Delete a file rm SomeUnusedClass.java cvs remove SomeUnusedClass.java cvs commit Check out the project cvs checkout <modulename> • In one operation cvs –d /home/kalle123/cvsstuff/ <modulename> • Affects checkout/update only • The old file can still be obtained from the repository! It’s version control! • Now we start adding files to the project 7 TDDB64 7 10 TDDB64 10 Adding and Updating Files CVS Revisions • • Add text file (or directory) to the repository cvs add MyClass.java cvs commit Revision numbers Assigned automatically 1.1, 1.2, 1.3, … • Add binary file to repository cvs add –kb UserGuide.doc cvs commit • Revision trees Non-linear development Branches Branch numbers • Commit changes cvs commit With logging message (comment) cvs commit –m “Fixed bug in print routine” • 1.2.2.1, 1.2.2.2, 1.2.2.3, … • Updated working directory • cvs update –d Merging 8 TDDB64 8 11 TDDB64 11 Importing a Project to CVS Creating releases • • Adding an entire directory of source files Symbolic labeling of versions Snapshot of current code configuration Useful when you release new versions cvs import <repostory> <vtag> <rtag> repostory -- the repostory directory vtag -- “vendor tag” rtag -- release tag • Label a release cvs tag –R “rel-1.0beta2” cvs commit • Check out a specific release cvs co –r “rel-1.0beta2” 9 TDDB64 9 12 TDDB64 12 2 CVS Command Summary • cvs checkout modules… Creates private copy of the source for modules • cvs update Updates your copies of the source files • changes other have made • cvs add file… Declare addition of file • cvs remove file… Declare removal of file Commit needed to perform action on repository • cvs commit file… Publish changes to other developers 13 TDDB64 13 CVS Clients • Several clients See http://www.cvshome.org/ • Unix Solaris – cvs command • Windows Cygwin – http://www.cygwin.com/ • Macintosh MacCVS – http://www.cvsgui.org/ • Cross platform jCVS – Java – http://www.jcvs.org/ SmartCVS – Java – http://www.smartcvs.com/ TkCVS – Tcl/Tk – http://tkcvs.sourceforge.net/ 14 TDDB64 14 TDDB64 15 15 3