Download presentation
Presentation is loading. Please wait.
Published byEthel Richard Modified over 9 years ago
1
CSE 219 Computer Science III CVS https://www.cvshome.org/new_users.html
2
CVS (Concurrent Versions System) The dominant open-source version control system Maintains the history of changes made to a set of files by one or more users. –Provides access for multiple coders to modify files concurrently (working on a software development team) Allows teams to coordinate their changes –Provides back-up for all work Built atop RCS (Revision Control System) –RCS is hidden from CVS users Maintains a repository (central code station) and developers “check-out” and “commit” files, directories and modules. –repository may be on local machine or server
3
CVS Information Official CVS website –http://www.cvshome.org/docs/http://www.cvshome.org/docs/ Eclipse supports CVS: –http://www.eclipse.org/eclipse/faq/eclipse-faq.html#users_7http://www.eclipse.org/eclipse/faq/eclipse-faq.html#users_7 Unix CVS –man cvs –you may be required to use this in an upper- division course In HW 4, you will be expected to use CVS In the software tool quiz, you will be required to demonstrate use of CVS
4
CVS Capabilities Retrieve old versions of source code Compute diffs showing the changes between any two old versions of source code Merge changes made by other programmers into private working copy Get revision history describing changes made since initial version CVS is concurrent –Traditional revision control systems – one coder could check- out and modify files at a time –CVS uses an unreserved check-out model –CVS can automatically merge changes made by multiple coders
5
CVS Repository Central store of all files managed by CVS –Maintained by CVS in a special format (DO NOT CHANGE DIRECTLY!) Repository is created by importing files. Users checkout files from the repository into private working areas. Modified files in private working areas are then checked-in to the repository by committing the changes. Users can update their working copies with changes committed by other users. Users can add new files to the repository or remove files from the repository. A team may only need one repository for all its projects Each commit is stamped with time/date and user id
6
Setting up CVS (UNIX) First create a root directory for the repository (e.g. ~/cvsroot) Make CVS aware of the root directory: –In Csh: setenv CVSROOT ~/cvsroot –In Bash, Bourne shell: CVSROOT=~/cvsroot export CVSROOT Add the CVSROOT setting command to appropriate startup file –~/.cshrc or ~/.bashrc Initialize the repository (cvs init)
7
CVS import Creates a module in the repository –cvs import –m "LOG" widget ORIG VERSION0 Here, "widget" is the name by which you will identify your code to CVS in all subsequent commands –your module The string ORIG is called the "vendor tag" VERSION0 is an initial "release tag" which you use to identify the version of the software just imported If –m is omitted, CVS opens up EDITOR for entering a log message. –EDITOR is an environment variable that is set to some default editor –To change your default editor with the bash shell: EDITOR=xemacs export EDITOR
8
CVS checkout Gets files from repository to private working area –your present working directory Get the latest version of widget & descendents –cvs checkout widget Get the latest version of widget/Hello.java –cvs checkout widget/Hello.java Get widget as of specific date. –cvs checkout –D "1 Apr 2008" widget Get widget with given revision tag. –cvs checkout –r Version3 widget
9
Other CVS commands Committing changes to the repository, ex: –cvs commit Hello.java Refreshing your personal working copy from the repository, ex: –cvs update Adding new source code files to your personal copy: –cvs add HelloAgain.java Deleting files from the repository –cvs rm Hello.java Renaming files not allowed! Merges handles changes in independent lines automatically; –other conflicts must be resolved manually. Use cvs diff to identify changes (for manual resolution).
10
Revision history & status Each revision has a revision number assigned by CVS (e.g. 1.3, 1.4, etc.) and may have a user-assigned symbolic tag. cvs log : Shows development along main branch: –revision numbers and (user-given) log messages. –If you are working on a development team, make sure you always provide log messages. Why? cvs log filename : Show revision history for given file name. cvs status : Shows status (up-to-date, needs update, needs merge, unresolved conflict, etc.) of working directory. cvs status filename : Show status of given file name.
11
CVS diff cvs diff : Shows differences between working version and most recent version in the repository. cvs diff –D "31 Mar 2008" : Shows difference between working version and repository version with the given date. cvs diff –r Version0 : Shows difference between working version and repository version with the given symbolic tag. Also: –cvs diff –r 1.1 Hello.java –cvs diff –r 1.1 –r 1.3 Hello.java
12
Tortoise CVS Provides all the same functionality –check out, commit, update, etc … Features: –Allows version control over the internet specify server –Graphical diff viewer –Resolve merge conflicts graphically –http://www.tortoisecvs.org/http://www.tortoisecvs.org/ –Video Tutorial to be posted
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.