Software Development Using CVS, ACM Mumbai - 09th Nov, 2001
Roadmap
- What is version control ?
- Why version control ?
- How CVS evolved ?
- How to use it ?
- Example project
What is version control ?
- Keeping old versions of program.
- Keeping track of these versions.
- Manipulation of these versions.
Why version control ?
| Scenario |
: single user single project |
| Problem |
: loss of older versions/snapshots |
| |
| Scenario |
: multiple user single project |
| Problem |
: concurrent updation of a file |
Why version control ? (contd..)
- Encourages documentation of changes, change log.
- Easy to manage parallel development of different versions of a file.
- Regulates multiple developers wanting to change the same file.
How it evolved ?
- Initial CVS shell scripts were written by Dick Grune.
- Developed on newsgroup (comp.sources.unix, vol-6, december-1986).
- Current version uses very small part of the original.
- Brian Berliner redesigned and coded CVS (1989).
- Jeff Polk later helped Brian (module and vender branch support).
How it evolved ? (contd..)
- CVS is based on RCS (Revision Control System).
- RCS was designed by Walter Tichy (1982).
- Designed for maintaining revisions of documents, drawings, forms, articles, source code.
- Other version control systems - AT&T's SCCS, IBM's CLEAR/CASTER, DEC'S CMS.
Environment Setup
- CVSROOT - location of repository (contains protocol, username, server, path-to-cvsrootdir)
- CVS_RSH - remote shell command to use when starting a cvs server.
- CVSEDITOR - editor to use for recording log messages (during commit).
- CVSREAD - makes the files in the working directory read-only (during checkout and update).
Anonymous User Commands
- Logging in
$ cvs -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/vm login
- Checking out
$ cvs checkout module/file/dir
- Updating
$ cvs update
Anonymous User Commands (Contd..)
- Status indication letter for each file in the working directory :
U, P, A, R, M, C, ?
- Some command modifiers :
$ cvs -z3 update -d
$ cvs -z3 update -l
$ cvs -z3 -n update -d
Developers Commands
- Comitting
$ cvs commit [files..]
$ cvs commit -m "log message" [files..]
- Adding/removing files
$ cvs add [files..]
$ cvs remove [files..]
- Creating patches
$ cvs diff -u> my_cvs.patch
- Version numbers
$ cvs commit -r 3.0
Repository Management Commands
- Creating a repository
$ cvs -d /var/lib/cvs init
- Importing a project
$ cvs project/pilot pilot-team start
- Managing modules
$ cvs co CVSROOT/modules
pilot project/pilot
$ cvs co pilot
Repository Management Commands (contd..)
- Revisions
$ cvs commit -r 3.0
- Tags
$ cvs tag rel-1-0 .
$ cvs checkout -r rel-1-0 modulename
Repository Management Commands (contd..)
- What to tag
$ cvs tag -c rel-1-0 .
$ cvs tag -r 1-0 rel-1-0 modulename
$ cvs tag -D date-spec rel-1-0 modulename
- Deleting, moving, renaming tags
$ cvs tag -d rel-1-0 .
$ cvs tag -r 1-6 -F stable modulename
$ cvs tag -r old-tag-1-0 rel-1-0 modulename
$ cvs tag -d old-tag-1-0 modulename
Repository Management Commands (contd..)
- Creating a branch
$ cvs tag -b rel-1-0-patches
$ cvs rtag -b -r rel-1-0 rel-1-0-patches modulename
- Accessing branches
$ cvs checkout -r rel-1-0-patches modulename
$ cvs update -r rel-1-0-patches modulename
Repository Management Commands (contd..)
Repository Management Commands (contd..)
Repository Management Commands (contd..)
Repository Management Commands (contd..)
References
Copyright © 2000-2005 Pankaj Jangid