Concurrent Versions System Overview of CVS architecture Repository

  • Slides: 19
Download presentation
Concurrent Versions System • Overview of CVS architecture. • Repository structure. • Basic development

Concurrent Versions System • Overview of CVS architecture. • Repository structure. • Basic development tasks in Win. Cvs. • Branching and merging. • Other CVS interfaces Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999

CVS Features • Concurrent access by multiple developers • Multiple development lines in a

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

The CVS Repository ewacvs: /data 1/cvsroot CVSROOT shr project 1 project 2 project 3

The CVS Repository ewacvs: /data 1/cvsroot CVSROOT shr project 1 project 2 project 3 devkits ar cgi doc install reports cgipr unix nt • Resides on a server • No working files inside the repository Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999 util web esapps forms

CVS Usage Model Checkout, Commit, Update • Checkout Makes private copy in working directory

CVS Usage Model Checkout, Commit, Update • Checkout Makes private copy in working directory Can check out anywhere Check out multiple copies, multiple versions • Update Brings working copy up to date with repository • Commit changes to the repository when finished Working copies must be up to date with repository Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999

Checkout does not lock the files in repository Concurrent checkout Master Repository foo. c

Checkout does not lock the files in repository Concurrent checkout Master Repository foo. c che cko st te t la u ko ec ch Karen Working Copy V 1. 7 checkin V 1. 8 or 1. 9 checkout V 1. 1 Michael ch checkout V 1. 2 Chris Working Copy V 1. 1 Working Copy V 1. 2 X X checkin prohibited Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS ec 1999 ut b ko ut la te st ran ch r el_1 Brigid Working Copy V 1. 7 checkin V 1. 8 or 1. 9 _fix Patrick Working Copy V 1. 2. 2. 1 checkin V 1. 2. 2. 2

CVS and the Development Cycle 1. Check out source files in working directory. 2.

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 4. 6. Commit changes. 7. Repeat from step 2 until you have a new release. 8. Tag the release. 9. Submit the module name and release tag for integration build. Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999

Common CVS commands cvs [ cvs-options ] command [cmd-options ] [files] cvs checkout Check

Common CVS commands cvs [ cvs-options ] command [cmd-options ] [files] cvs checkout Check out source for editing. cvs add Add new file/directory to repository. cvs remove Remove an entry from the repository. cvs status Show status of checked out files. cvs log Show revision history for files. cvs diff Compare working files to version in repository or versions inside the repository. cvs update Bring working files into sync with repository. cvs commit check files into the repository cvs tag Label the sources. Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999

When to commit • Commit to mark a working state that you might want

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. Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999

Working on branches _fi x cvs tag -b rel_1_fix patch 1. 2. 2. 2

Working on branches _fi x cvs tag -b rel_1_fix patch 1. 2. 2. 2 rel _1 1. 2. 2. 1 1. 2 1. 3 release_1 1. 4 release_2 cvs up -r rel_1_fix cvs tag release_1 Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS cvs tag release_2 1999

Branch if you need. . . • to create sustaining (patch) releases • to

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

Ideal development with CVS development checkout checkin update Developer A repository Developer B Warren

Ideal development with CVS development checkout checkin update Developer A repository Developer B Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999

Real development with CVS checkin conflict checkin update resolution Developer A repository X Warren

Real development with CVS checkin conflict checkin update resolution Developer A repository X Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999 Developer B conflict

Reserved Checkouts and CVS Exclusive file locking prevents parallel development and is not recommended

Reserved Checkouts and CVS Exclusive file locking prevents parallel development and is not recommended for plain text files • advisory locks: implemented via cvs edit and cvs watch. Get notification when someone edits or checks in the file. • all-o-nothing advisory locks: cvs edit does not succeed if files are already edited by someone else. Implemented using a patch to cvs edit • exclusive locks (RCS style): implemented via cvs admin. You cannot commit unless you’ve locked the file. One lock per file per branch. Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999

Advisory locks Developer A email alert CVS server tch a w / t i

Advisory locks Developer A email alert CVS server tch a w / t i d e Editors: it Developer A Developer B Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS Developer B ed 1999

Client-server architecture • separate server (UNIX or NT) • no shared filesystems • a

Client-server architecture • separate server (UNIX or NT) • no shared filesystems • a server process per connection ewacvs Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999

Win. CVS on your desktop • • Configuration Main screen Checking out the sources

Win. CVS on your desktop • • Configuration Main screen Checking out the sources Viewing source history Diff Commit Update Tag Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999

Other CVS clients CVSweb Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction

Other CVS clients CVSweb Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999 Diff Directory between listing 2 versions of the file

Other CVS clients j. CVS Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co.

Other CVS clients j. CVS Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999 Directory Diff betweenlisting 2 versions of the file

CVS online • Official CVS site: • CVS Bubbles: http: //www. cyclic. com http:

CVS online • Official CVS site: • CVS Bubbles: http: //www. cyclic. com http: //www. loria. fr/~molli/cvs-index. html • CVS for Web development: • Win. Cvs: http: //durak. org: 81/cvswebsites http: //www. wincvs. org • j. CVS: http: //www. jcvs. org/ • Netscape’s Mozilla under CVS: http: //cvsmirror. mozilla. org/webtools/tindertest/showbuilds. cgi? tree=Sea. Monkey • Free. BSD CVS repository: http: //www. freebsd. org/support. html#cvs Warren Jones, Fluke Co. , Eugene Kramer, Remedy Co. Introduction to CVS 1999