Find ppt version (CVSDemo.ppt) in http://groups.yahoo.com/group/bdosdn/files/Seminar20070721/
or read below...Concurrent Versions System
Presented by:
K. M. Fazle Azim
Member, BDOSDN
fazle_azim@centionsoftware.com
Presented in:
OSS Seminar organized by BDOSDN and IT Bangla Ltd. (Dhaka, Bangladesh, 21 July 2007)
What is a “Versioning System”?
- Record the history of files
- Share code within a group
- Have multiple people edit the same files
- Merge changes from different people
- Go back in time
The Dark Ages
- Saving every version of every file you have ever created.
- Saving current state of project every so often
- This would however waste an enormous amount of disk space.
- People would have to communicate to make sure only one person was editing at a time.
But now CVS in action ...
- CVS allow you to:
- store and retrieve multiple versions of a file
- Compare different versions of a file
- Perform parallel development
- Not just for code:
- Documentation
- Config files
- Etc
Terminology
- Repository
- Where the source code management system stores its copy of your file
- Sandbox
- Your personal working copy
- You make your changes and then put it back in the repository
- Check out / check in
- You check files out of the repository (into the sandbox)
- Edit them
- Check them back into the repository
- Branch
- Separate development path
- V1.0 of your program has been released
- Now you work on v2.0 as a new branch
- A bug has been found in v1.0 so you make a bug fix and have v1.1
- Merge
- Eventually, v1.1 has to be merged back into main line of development, into v2.0
DEMO
What we are going to do
- Create a repository
- Put some files into repository
- Check out the files and edit them
- Insert keyword substitution for documentation
- Check it back into the repository
cvs command syntax
- Cvs [cvs-options] command [command-options] [command-args]
- Cvs-options are for the CVS system itself.
- The command options and command args are for the subcommand only
Creating a Repository
- Initialize the value of CVSROOT
- $export CVSROOT=/var/cvs
- OR
- $export CVSROOT=:ext:babu@cvs.cention.se:/var/cvs
- $export CVS_RSH=ssh
- Run cvs init:
- $cvs init
Putting stuff into the repository to get started
- Have a directory NOT in the repository
- with all your files you want to start with.
- cd into that directory:
- $cd /home/babu/workDir
CVS Import
- $cvs import project-name vendor-tag release-tag
- Vendor-tag
- Track 3rd party code, usually not needed
- Release-tag
- Current revision of vendor branch files
Import example
- cvs import is a good way to bootstrap a bunch of files into a new project
- $cvs import myProject start sample
Creating a New Sandbox
- cvs checkout project-name
- $cvs checkout myProject
- Directory myProject now created in your sandbox and it contains all the files in the myProject directory in the repository
- Now, you can cd to myProject of sandbox and edit, etc.
Checkin
- The checkin command in CVS is “commit”
- cvs commit [filename1 filename2]
- Will update repository for the named files
- If no files named, updates all file changes in the
- sandbox to the repository
- Note - the repository is not changed until the commit is requested, no matter how much editing you do, so don’t forget to end your session with a commit
To check out a single file
- cvs update [file1 file2 …]
- Downloads changes from repository to an existing sandbox
- Merges changes from repository into changed files in the sandbox
- If no files names, do all files in project
Status and Log
- cvs status [files …]
- Status of ifles such as current working version and version in the repository
- cvs log [files …]
- Displays a log regarding files in the current sandbox
Remove a Repository and Release a Sandbox
- cvs remove files
- Removes files structure from repository
- cvs release [-d] files
- Releases [-d and removes] the sandbox files
Monday, July 23, 2007
Presenation: Concurrent Versions System (CVS)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment