49
Concurrent Versions System version control system -1 -

Linux13 concurrent versions system

Embed Size (px)

DESCRIPTION

Linux CVS

Citation preview

Page 1: Linux13 concurrent versions system

Concurrent Versions System

version control system

-1-

Page 2: Linux13 concurrent versions system

• CVS is a version control system. • Use to record the history of

your source files.

Concurrent Versions System

-2-

Page 3: Linux13 concurrent versions system

• For example, bugs sometimes creep in when software is modified, and you might not detect the bug until a long time after you make the modification.

Concurrent Versions System

-3-

Page 4: Linux13 concurrent versions system

• With CVS, you can easily retrieve old versions to see exactly which change caused the bug. This can sometimes be a big help.

Concurrent Versions System

-4-

Page 5: Linux13 concurrent versions system

• You could of course save every version of every file you have ever created. This would however waste an enormous amount of disk space.

Concurrent Versions System

-5-

Page 6: Linux13 concurrent versions system

• CVS stores all the versions of a file in a single file in a clever way that only stores the differences between versions.

Concurrent Versions System

-6-

Page 7: Linux13 concurrent versions system

• CVS also helps you if you are part of a group of people working on the same project. It is all too easy to overwrite each others' changes unless you are extremely careful.

Concurrent Versions System

-7-

Page 8: Linux13 concurrent versions system

• CVS solves this problem by insulating the different developers from each other. Every developer works in his own directory, and CVS merges the work when each developer is done.

Concurrent Versions System

-8-

Page 9: Linux13 concurrent versions system

• CVS started out as a bunch of shell scripts written by Dick Grune, posted to comp.sources.unix in the volume 6 release of December, 1986.

Concurrent Versions System

-9-

Page 10: Linux13 concurrent versions system

• CVS is primarily used as a source code control system for text files. Programmers will generate revisions to individual source code files. A collection of these files may define a specific software release.

Concurrent Versions System

-10-

Page 11: Linux13 concurrent versions system

• CVS aims to manage the collection of these files and the respective revisions of the individual files that make up the collection.

Concurrent Versions System

-11-

Page 12: Linux13 concurrent versions system

• CVS is a command driven file checkout, update, compare and management system. • CVS implements RCS for management

of individual files through the use of the CVS command set. Front end web and desktop GUI systems are available to ease in the use of CVS.

Concurrent Versions System

-12-

Page 13: Linux13 concurrent versions system

• CVS is a command driven file checkout, update, compare and management system. • CVS implements RCS for management

of individual files through the use of the CVS command set. Front end web and desktop GUI systems are available to ease in the use of CVS.

Concurrent Versions System

-13-

Page 14: Linux13 concurrent versions system

Set environment variables: (add to your .bashrc file)

Environment variables: # export

CVSROOT='/home/Project/CVS_root' (directory for CVS source code repository)

# export CVSEDITOR=/bin/vi

Setting up your environment for CVS:

-14-

Page 15: Linux13 concurrent versions system

Set environment variables: (add to your .cshrc file) (for csh users)

Environment variables:# setenv CVSROOT '/home/Project/CVS_root'# setenv CVSEDITOR /bin/vi

• CVSROOT: Location of CV source code repository.

Setting up your environment for CVS:

-15-

Page 16: Linux13 concurrent versions system

Set environment variables: (add to your .cshrc file) (for csh users)

Environment variables:# setenv CVSROOT '/home/Project/CVS_root'# setenv CVSEDITOR /bin/vi

• CVSROOT: Location of CV source code repository.

Setting up your environment for CVS:

-16-

Page 17: Linux13 concurrent versions system

• CVS stores all files in a centralized repository: a directory (such as `/usr/local/cvsroot') which is populated with a hierarchy of files and directories.

Basic concepts

-17-

Page 18: Linux13 concurrent versions system

You never access any of the files in the repository directly.

Instead, you use CVS commands to get your own copy of the files, and then work on that copy.

Basic concepts

-18-

Page 19: Linux13 concurrent versions system

The files in the repository are organized in modules.

Each module is made up of one or more files, and can include files from several directories.

A typical usage is to define one module per project.

Basic concepts

-19-

Page 20: Linux13 concurrent versions system

A revision number always has an even number of period-separated decimal integers.

By default revision 1.1 is the first revision of a file.

Revision numbers

-20-

Page 21: Linux13 concurrent versions system

Each version of a file has a unique revision number.

Revision numbers look like `1.1', `1.2', `1.3.2.2' or even `1.3.2.2.4.5'.

Revision numbers

-21-

Page 22: Linux13 concurrent versions system

Each successive revision is given a new number by increasing the rightmost number by one.

The following figure displays a few revisions, with newer revisions to the right.

Revision numbers

-22-

Page 23: Linux13 concurrent versions system

Revision numbers

CVS is not limited to linear development.

The revision tree can be split into branches, where each branch is a self-maintained line of development. Changes made on one branch can easily be moved back to the main trunk.

-23-

Page 24: Linux13 concurrent versions system

Each branch has a branch number, consisting of an odd number of period-separated decimal integers.

Revision numbers

-24-

Page 25: Linux13 concurrent versions system

The branch number is created by appending an integer to the revision number where the corresponding branch forked off. Having branch numbers allows more than one branch to be forked off from a certain revision.

Revision numbers

-25-

Page 26: Linux13 concurrent versions system

All revisions on a branch have revision numbers formed by appending an ordinal number to the branch number. The following figure illustrates branching with an example.

Revision numbers

-26-

Page 27: Linux13 concurrent versions system

Revision numbers

-27-

Page 28: Linux13 concurrent versions system

The exact details of how the branch number is constructed is not need to be concerned about. how it works: When CVS creates a branch number it picks the first unused even integer, starting with 2.

Revision numbers

-28-

Page 29: Linux13 concurrent versions system

So when you want to create a branch from revision 6.4 it will be numbered 6.4.2.

All branch numbers ending in a zero (such as 6.4.0) are used internally by CVS.

The branch 1.1.1 has a special meaning.

Revision numbers

-29-

Page 30: Linux13 concurrent versions system

A file can have several versions, as described above. Likewise, a software product can have several versions. A software product is often given a version number such as `4.1.1'.

Versions, Revisions and Releases

-30-

Page 31: Linux13 concurrent versions system

Versions in the first sense are called revisions in this document, and versions in the second sense are called releases.

To avoid confusion, the word version is almost never used in this document.

Versions, Revisions and Releases

-31-

Page 32: Linux13 concurrent versions system

• CVSNT keeps track of the version history of a project (or set of files).• CVSNT is based on the same

client-server architecture as the Concurrent Versions System: __

CVSNT

-32-

Page 33: Linux13 concurrent versions system

– a server stores the current version(s) of the project and its history, and clients connect to the server in order to check-out a complete copy of the project, work on this copy and then later check-in their changes.

CVSNT

-33-

Page 34: Linux13 concurrent versions system

• A server may be a caching or proxy server (a read only server that passes on write requests to another server) or a read and write (normal) server.

CVSNT

-34-

Page 35: Linux13 concurrent versions system

Concurrent Versions System

For More On CVS....Next Lecture....

-35-

Page 36: Linux13 concurrent versions system

Concurrent Versions System

LECTURE :: 2

-36-

Page 37: Linux13 concurrent versions system

• Access control for securing projects and branches.• Detailed audit and metrics

recorded in an SQL database.• Authentication with Active

Directory.

CVSNT Server features include:

-37-

Page 38: Linux13 concurrent versions system

• Tracking everything about the change - including whether it was merged from somewhere• A control panel to manage email

notification of changes, defect tracking integration, and more.

CVSNT Server features include:

-38-

Page 39: Linux13 concurrent versions system

• Integrated repository synchronization (for fail-over servers).• Supports UNICODE UTF-8/UCS-2

files and multi-lingual filenames.• Native servers available for Mac

OS X, Windows, Linux, Solaris, HPUX.

CVSNT Server features include:

-39-

Page 40: Linux13 concurrent versions system

• Supports reserved and unreserved versioning methodologies.• CVSAPI for integration into 3rd

party products.• Script, COM and 3GL interface for

triggers and integration into 3rd party tools (such as defect tracking)

CVSNT Server features include:

-40-

Page 41: Linux13 concurrent versions system

• CVSNT can do a lot of things for you, but it does not try to be everything for everyone.• cvsnt is not a build system.• cvsnt does not dictate how you

build anything. It merely stores files for retrieval in a tree structure you devise.

CVSNT Limitations:

-41-

Page 42: Linux13 concurrent versions system

• CVNT does not dictate how to use disk space in the checked out working directories. If you write your Makefiles or scripts in every directory so they have to know the relative positions of everything else, you wind up requiring the entire repository to be checked out.

CVSNT Limitations:

-42-

Page 43: Linux13 concurrent versions system

• CVSNT is not an automated testing program. • CVSNT does not have a built-in

process model.

CVSNT Limitations:

-43-

Page 44: Linux13 concurrent versions system

• It is possible to use CVS with multiple user but we take example for one user with user name foobar.

1.First Login as root, and execute the following.

Working With CVS

-44-

Page 45: Linux13 concurrent versions system

2) To provide cvs rights to "foofoo", but it can be any user on your system. # mkdir /usr/local/cvs # chown mark /usr/local/cvs

Working With CVS

-45-

Page 46: Linux13 concurrent versions system

3) Now login as "foobar" and do the following.

4) Edit your .bashrc file using vi or emacs or other, and enter these commands.

# CVSROOT=/usr/local/cvs

Working With CVS

-46-

Page 47: Linux13 concurrent versions system

5) Save and then execute "source .bashrc".

Now when you log in, it will setup your environment to use this directory by default if you don't specify a directory to use.

Working With CVS

-47-

Page 48: Linux13 concurrent versions system

6) Make a directory, which is need for cvs.

# mkdir /usr/local/cvs/CVSROOT

7) Upload files to the CVS repository

Working With CVS

-48-

Page 49: Linux13 concurrent versions system

Its All A

bout CVS

Thank You....!!!!

-49-