Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 Concurrent Versions System Overview of CVS architecture. Repository structure. Basic development tasks in CVS. Branching and merging.
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 CVS Features Concurrent access by multiple developers Multiple development lines in a single repository Grouping sources into modules Symbolic source tagging Diffs between versions Configurable logging support Binary files support Repository event triggers
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 Client-server architecture ewacvs separate server (UNIX or NT) no shared filesystems a server process per connection
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 The CVS Repository ewacvs:/data1/cvsroot CVSROOT shr project1 project2 project3 devkits ar cgi doc install reports util web cgipr Resides on a server No working files inside the repository esapps forms unix nt
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 CVS Usage Model Checkout, Commit, Update Checkout Makes private copy in working directory Can check out anywhere Check out multiple copies, multiple versions Commit Commit changes to the repository when finished Working copies must be up to date with repository Update Brings working copy up to date with repository
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 Concurrent checkout Master Repository foo.c Working Copy V1.7 Working Copy V1.1 Working Copy V1.2 Working Copy V1.7 Working Copy V checkout branch rel_1_fix checkout latest checkout V1.2 checkout V1.1 Karen Michael Brigid Patrick Checkout does not lock the files in repository XX V1.8 or 1.9 V checkin checkin prohibited Chris
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 CVS and the Development Cycle 1. Check out source files in working directory. 2. Edit source files. 3. Unit test your code. 4. Update working files to merge in changes from other developers (if necessary). 5. Test again if the sources were merged on step Commit changes. 7. Repeat from step 2 until you have a new release. 8. Tag the release.
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 checkoutupdatecheckindevelopment Ideal development with CVS repository Developer A Developer B
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 checkin X Real development with CVS repository Developer A Developer B updateconflict resolution checkin conflict
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 CVS on your desktop Configuration: setenv CVSROOT ext:iim.lti.cs.cmu.edu/usr0/javelin/cvsroot Checking out the sources cvs checkout planner (repository gui ag aj ix rs em qa) Update Commit
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 Common CVS commands cvs [cvs-options] command [cmd-options] [files] cvs checkoutCheck out source for editing. cvs addAdd new file/directory to repository. cvs removeRemove an entry from the repository. cvs statusShow status of checked out files. cvs logShow revision history for files. cvs diffCompare working files to version in repository or versions inside the repository. cvs updateBring working files into sync with repository. cvs commitcheck files into the repository cvs tagLabel the sources.
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 CVS Update Messages cvs update foo.c CVS is silent about unchanged files M foo.cYou have modified foo.c U foo.cSomeone else has modified foo.c C foo.cCONFLICT! You and someone else independently modified foo.c A foo.cYou have added foo.c (using cvs add) R foo.cYou have removed foo.c (using cvs remove) ? foo.cNothing known about foo.c (perhaps you should cvs add foo.c?)
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 When to commit Commit to mark a working state that you might want to return to later. Commit related files in a single operation. Use a common log message for all the files. Commit to backup your sources. Commit from an office desktop to be able to access the files from home much faster than through filesystem sharing. Always provide a log message: cvs commit –m “[message]” [files]
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 Working on branches release_1 cvs tag release_1 cvs up -r rel_1_fix 1.4 release_2 cvs tag release_ patch rel_1_fix cvs tag -b rel_1_fix
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 Branch if you need... to create sustaining (patch) releases to have multiple development lines from a single repository to do experimental development to merge later or forget about it to keep temporary state of development without affecting builds
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 CVS online Official CVS site: CVS Bubbles: CVS for Web development: WinCvs: jCVS: Netscape’s Mozilla under CVS: FreeBSD CVS repository: