Title: Versioning Systems
1Versioning Systems
Has one of your projects ever looked like this ?
Working alone Probably manageable Working in a
group Good luck!
2Versioning Systems Ways of avoiding a repository
mess
- Versioning Systems allow
- To store one master copy of the source code
- multiple users to modify the same code
- automated updates between versions
- Access to any previous state of the source code
3CVS dos and donts
- Facilitates bug detection when software is
modified - Economy in disk space while saving versions
- Prevents code over-writing in a team project
- Not a build system
- Not a substitute for communication between
developers or for management - No change control available
4Revision numbers
5DISCOVER example session Variables
- Setting up variables
- CVS_RSH What remote shell to use
- CVSROOT Tells where the repository is
- Example
- sh/ksh export CVS_RSHssh
- csh setenv CVS_RSH ssh
- sh/ksh export CVSROOT/caip/u2/DevGroup/cvsroot/
- csh setenv CVSROOT /caip/u2/DevGroup/cvsroot
6DISCOVER example session Getting the source
code
- Get to a working directory on local computer (cd
/work/) - cvs checkout DISCOVER/Client/java or
- cvs co DISCOVER/Client/java
- Will download all source files into the current
directory. - Similarly using Module name Client
- cvs co Client
7DISCOVER example session Committing a change
- Checking file in repository
- cvs commit ltfile1gt,ltfile2gt,
- If no filename is given all files are scanned by
CVS and all modified files are committed.
8DISCOVER example session Adding a file
- To add a file or directory to be checked by CVS
- cvs add ltfile1gt,ltfile2gt,
- cvs commit
- To add an entire directory of source files
- cvs import ltrepositorygt ltvtaggt ltrtaggt
- repository is the directory name in the
repository - vtag is a vendor tag for entire branch 1.1.1
- rtag is a release tag
9DISCOVER example session removing a file
- Local file needs to be deleted and then removed
from the repository - rm ltfile1gt,ltfile2gt,
- cvs remove ltfile1gt,ltfile2gt,
- cvs commit
10Branches
- Tag symbolic name for revision of file
- -v flag in status see tags and rev. nos.
- Tag all files at strategic points release
- -r flag in checkout checkout a rev. no.
- Need for branches good for bug-fixing
- Put modified code in branch and later merge with
main trunk
11DISCOVER example session branching out
- Create your independent branch (harmless to the
main trunck) - cvs b r release1-0 release1-0-patch SRC
- Merging a branch back to the main trunck
- cvs j ltbranchnamegt
12Modules
- modules are alias names to projects kept in the
repository. - More convenient to call a module name rather
than a long pathname - Example
- If repository is in
- /home/cvsroot/Project_AX/Client/Synchronous/withLi
mit - A module could declare this simply as Client
13Defining the module
- Get working copy of modules file
- Edit file to define new module
- Commit changes to modules file
- Release the working copy
- Eg - cvs checkout CVSROOT/modules
- new line newdir newcode/newdir
- cvs commit m Added module modules
- cvs release d modules
14cvs Status
- Status gives the state of the file
- Up-to-date latest revision
- Locally modified not committed changes
- Locally added added but not committed
- Locally removed removed, not committed
- Needs checkout, Needs merge
- Unresolved Conflict update conflict
- Unknown
15Tracking mechanisms
- cvs watchinfo to inform other about commits
- cvs watch on/off places watch on files
working copies created as read-only - cvs watch add/remove CVS notification
- cvs edit/unedit edit/abandon watched files
- cvs watchers/editors list of users watching
changes or working on files
16Links
GNUs site on CVS http//www.gnu.org/manual/cvs/h
tml_chapter/cvs_20.html CVS Man
page http//hoth.stsci.edu/man/man1/cvs.html