cvs & eclipse1 department of computer science and software engineering concordia university feb...

62
CVS & Eclipse 1 CVS & Eclipse CVS & Eclipse DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet by Emil Vassev & Joey Paquet revision 1.3 – Jan 19, 2009 revision 1.3 – Jan 19, 2009

Upload: tamsyn-montgomery

Post on 04-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 1

CVS & EclipseCVS & Eclipse

DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY

Feb 26, 2006

by Emil Vassev & Joey Paquetby Emil Vassev & Joey Paquet

revision 1.3 – Jan 19, 2009revision 1.3 – Jan 19, 2009

Page 2: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 2

Outline

Version Control Systems - IntroVersion Control Systems - Intro CVSCVS

Basic ConceptsBasic Concepts CVS BranchesCVS Branches Quick Reference to CVS CommandsQuick Reference to CVS Commands

CVS & EclipseCVS & Eclipse Getting StartedGetting Started Putting a Project into CVSPutting a Project into CVS Getting a Project from CVSGetting a Project from CVS Updating/Committing ChangesUpdating/Committing Changes Comparing Two File VersionsComparing Two File Versions

Rational ClearCaseRational ClearCase

Page 3: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 3

Version Control SystemsVersion Control Systems

Page 4: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 4

Version Control Systems

Why use a version control system? To have a common repository for all project files available and

updated remotely. To make sure that concurrent changes to the same file are

properly handled. To allow the branching of versions in a seamless operation. To avoid copying all files when creating a new version of a

project.

:: Why do We Need Them? - I

Page 5: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 5

Version Control Systems

Why use a version control system? To make sure that everybody in a team is always using the

correct version of project files. To ensure a proper rollback sequence in the event that some

changes need to be undone. To compare the differences between different file versions

(using diff). To access previous project versions seamlessly (using version

tagging)

:: Why do We Need Them? - II

Page 6: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 6

Version Control Systems

Maximizing productivity by automating tasks. Reducing confusion, minimizing mistakes. Maximizing software integrity, traceability, and

accountability. Assisting developers in providing coordinated changes

to software products and components. Accurately recording the composition of versioned

software products evolving into many revisions and variants.

Reconstructing previously recorded software components versions and configurations.

:: General Goals

Page 7: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 7

Version Control Systems

More advanced version control systems, like Rational’s ClearCase and Microsoft’s SourceSafe allow for multiple developers to work on the same file.

Then, when the last person checks it in, they have to option to merge the different paths together. Meaning that two people can change the same file and both save their changes.

Merging changes is a useful feature, but it has its flaws. What if two people complete different variations of the same change, which one should you keep?

:: Multiple Developers & Merging Changes

Page 8: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 8

Version Control Systems

A major concept of a version control system is the concept of a baseline.

All projects have this, for example, MS PowerPoint we are using for this presentation is Version 11.24.8036

11 is the major product version, 24 is the minor version, and 8036 is the build version.

The build version generally goes up by one every time a file is checked in, while the major/minor versions are usually advanced manually as the product is rolled out.

:: Baseline - I

Page 9: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 9

Version Control Systems

As a developer, you would have the option of rolling back to a previous baseline if something failed.

Baselines are also important in project management and planning, especially in iterative development.

A project manager might decide Prototype Version 1.0 would have certain features, and Version 1.1 would have others, so the final version of 1.0 might be 1.0.1087.

:: Baseline - II

Page 10: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 10

CVSCVS

Page 11: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 11

CVS

Version control is a process by which you can keep a recorded history of the changes to your files.

CVS states for Concurrent Version System (CVS). A version control system typically has two parts - a version

control server and clients. The version control server is accessed over a network – a local

network or wide area network such as the Internet – by a version control client.

The version control server manages access to the version control repository.

Version control clients come in a variety of flavors: command line clients, window/GUI clients (WinCVS), plug-in clients (for applications like Eclipse and file explorers).

:: Basic Concepts

Page 12: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 12

CVS

Repository This is where a copy of your files and directories are stored.

CVS uses some special file structure for tracking the differences between subsequent versions of a file.

Working Copy and Workspace This is a copy of a file(s) (or project) in your local file system

(not in the Repository). Workspaces map to Eclipse projects.

Project Group of files. A project is often a complete program;

although, a project could be code for a software library or the XML/HTML files for documentation.  

:: Basic Concepts

Page 13: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 13

CVS

Commit This is the process of saving files to the Repository. You may

commit specific files or a whole project to the Repository.

Synchronize This is the process of updating the local files on your computer

with corresponding files in the repository.

Checkout This is the process of retrieving files from the Repository, i.e.

downloading a local copy to your machine.

:: Basic Concepts

Page 14: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 14

CVS

What is a Branch? A CVS branch is a collection of revisions that for some reason

should not be committed onto the main trunk of development. If we want to work on a part of the code doing changes that we are not going to share until we are not satisfied with the result we could work on our own branch, without disturbing anyone else.

Branching is a powerful mechanism for controlled isolation. The original set of versions, before the branch was created, is

called the main line or main branch. After a branch is created the main line is still the default

version. We can always merge changes from a branch into the main

line or vice-versa.

:: CVS Branches

Page 15: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 15

CVS

Branching Scenario

Two programmers, Paul and Wing, working on separate branches of the same project.

Paul will branch off main and modify some files while Wing continues to work on the main branch, also modifying files.

Paul will then merge his branch back to the main branch. In doing so, Paul will address the resulting merge conflicts.

:: CVS Branches

Page 16: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 16

CVS

CVS maintains unique numbers for each each version of the files under CVS.

Revision numbers could be somewhat like “1.1”, “1.2”, “1.3.2.2” or “1.3.2.2.4.5”.

By default revision 1.1 is the first revision of a file. Each successive revision is given a new number by increasing the rightmost number by one.

Example: 1.1, 1.2, 1.3, 1.4

:: CVS Revisions

Page 17: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 17

CVS

Useful when we want to distinguish different releases of same software by its version number.

Example: 1.x states for release “one” and 2.x for release “two” We use the “-r” option to “cvs commit” to assign revisions

manually.

Example: To bring all the files up to revision 2.0 (including those that haven't changed), we invoke:

cvs commit -r 2.0

The number we specify with “-r” must be larger than any existing revision number.

If we want to maintain several releases in parallel, we need to use a branch.

:: Assigning Revisions - I

Page 18: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 18

CVS

Eclipse does not support "cvs commit -r“. Usually we would like to change the revision number from 1.x to

2.x if, for example, we completely re-written the file. Changing revisions from 1.x to 2.x would typically be something

we should do on a whole project, in order to baseline for a new release of the project.

That sort of thing is often better managed by using branches, though.

Eclipse support for maintaining different releases “Versions”.

:: Assigning Revisions - II

Page 19: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 19

CVS

A CVS Command looks like this:cvs [ global_options ] command [ command_options ] [ command_args ]

Global options: --allow-root=rootdir

Specifies legal CVSROOT directory (server only) -a

Authenticates all communication (client only) -b

Specifies RCS location -d root

Specifies the CVSROOT. -e editor

Edits messages with editor.

:: Quick Reference to CVS Commands

Page 20: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 20

CVS

A CVS Command looks like this:cvs [ global_options ] command [ command_options ] [ command_args ]

Global options - Continue: -f

Does not read the `~/.cvsrc' file. -H --help

Prints a help message. -n

Does not change any files. -Q

Be really quiet. -q

Be somewhat quiet.

:: Quick Reference to CVS Commands

Page 21: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 21

CVS

A CVS Command looks like this:cvs [ global_options ] command [ command_options ] [ command_args ]

Global options - Continue: -r

Makes new working files read-only. -s variable=value

Sets a user variable. -T tempdir

Puts temporary files in tempdir. -t

Traces CVS execution.

:: Quick Reference to CVS Commands

Page 22: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 22

CVS

A CVS Command looks like this:cvs [ global_options ] command [ command_options ] [ command_args ]

Global options - Continue: -v --version

Displays version and copyright information for CVS. -w

Makes new working files read-write. -x

Encrypts all communication (client only). -z gzip-level

Sets the compression level (client only).

:: Quick Reference to CVS Commands

Page 23: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 23

CVS

A CVS Command looks like this:cvs [ global_options ] command [ command_options ] [ command_args ]

Commands: add [options] [files…]

Adds a new file/directory. admin [options] [files…]

Administration of history files in the repository. annotate [options] [files…]

Shows last revision where each line was modified. checkout [options] modules…

Gets a copy of the sources. commit [options] [files…]

Checks changes into the repository.

:: Quick Reference to CVS Commands

Page 24: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 24

CVS

A CVS Command looks like this:cvs [ global_options ] command [ command_options ] [ command_args ]

Commands - Continue: diff [options] [files…]

Shows differences between revisions. edit [options] [files…]

Gets ready to edit a watched file. editors [options] [files…]

Sees who is editing a watched file. export [options] modules…

Exports files from CVS. history [options] [files…]

Shows repository access history.

:: Quick Reference to CVS Commands

Page 25: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 25

CVS

A CVS Command looks like this:cvs [ global_options ] command [ command_options ] [ command_args ]

Commands - Continue: import [options] repository vendor-tag release-tags…

Imports files into CVS, using vendor branches. init

Creates a CVS repository if it doesn't exist. kserver

Kerberos authenticated server. log [options] [files…]

Prints out history information for files.

:: Quick Reference to CVS Commands

Page 26: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 26

CVS

A CVS Command looks like this:cvs [ global_options ] command [ command_options ] [ command_args ]

Commands - Continue: login

Prompts for password for authenticating server. logout

Removes stored password for authenticating server. pserver

Password authenticated server. rannotate [options] [modules…]

Shows last revision where each line was modified. rdiff [options] modules…

Shows differences between releases.

:: Quick Reference to CVS Commands

Page 27: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 27

CVS

A CVS Command looks like this:cvs [ global_options ] command [ command_options ] [ command_args ]

Commands - Continue: release [options] directory

Indicates that a directory is no longer in use. remove [options] [files…]

Removes an entry from the repository. rlog [options] [files…]

Prints out history information for modules. rtag [options] tag modules…

Adds a symbolic tag to a module. server

Rsh server.

:: Quick Reference to CVS Commands

Page 28: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 28

CVS

A CVS Command looks like this:cvs [ global_options ] command [ command_options ] [ command_args ]

Commands - Continue: status [options] files…

Displays status information in a working directory. tag [options] tag [files…]

Adds a symbolic tag to checked out version of files. unedit [options] [files…]

Undoes an edit command. update [options] [files…]

Brings work tree in sync with repository.

:: Quick Reference to CVS Commands

Page 29: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 29

CVS

A CVS Command looks like this:cvs [ global_options ] command [ command_options ] [ command_args ]

Commands - Continue: version

Display the version of CVS being used. If the repository is remote, display

both the client and server versions. watch [on|off|add|remove] [options] [files…]

on/off: turns on/off read-only checkouts of files.

add/remove: adds or removes notification on actions. watchers [options] [files…]

Sees who is watching a file.

:: Quick Reference to CVS Commands

Page 30: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 30

CVS & EclipseCVS & Eclipse

Page 31: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 31

CVS and Eclipse

First, you should enable the Eclipse perspective for CVS. From Window menu: [Window Open Perspective Other …] From the “Select Perspective” window pick up CVS Repository Exploring.

Second, you should show the CVS Repositories view. From Window menu: [Window Show View CVS Repositories]

:: Getting Started

Page 32: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 32

CVS and Eclipse

Next, you should connect to a CVS Repository.

Right mouse click in the CVS Repositories window.

From the right mouse click menu select

[New → Repository Location ...] Complete the Add CVS Repository dialog as

shown. Location Host: alpha.cs.concordia.ca Repository path: enter the path of the cvs

repository. Connection Type: extssh

:: Getting Started

Page 33: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 33

CVS and Eclipse :: Getting Started

After validation, CVS Repositories window in Eclipse will show the connected repository.

You can have multiple repositories.

Page 34: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 34

CVS and Eclipse :: Putting a Project into CVS

Select the project in the Navigator or other view. Right click [Context MenuTeamShare Project...] Follow the wizard for identifying your repository location and

and repository module name. The Synchronize view opens, showing all your outgoing

changes. Select the project in the Synchronize view. Right click [Context MenuCommit]. Answer yes when prompted to add new files to version control. Supply a release comment if you like.

The project now exists in the repository.

Page 35: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 35

CVS and Eclipse :: Putting a Project into CVS

Right mouse click in the CVS Repositories view and select Refresh View to see your project in the repository.

Page 36: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 36

CVS and Eclipse :: Getting a Project from CVS

Select [WindowShow ViewOther]. Select [CVSCVS Repositories]. Right click [Context MenuNewRepository Location...]. Fill in the location information identifying your repository and

click Finish. Expand the newly-created repository location. Find the module you are interested in. Right click [Context MenuCheck Out].

Page 37: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 37

CVS and Eclipse :: Updating/Committing Changes

If you have changed your source files and wish to commit those changes in your files that are in CVS, you do the following:

From the Java Perspective (or other similar perspective), right mouse click on the project and select [Team Commit... ]

Enter a comment in the Commit dialog and press Finish.

New version for modified files

Page 38: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 38

CVS and Eclipse :: Comparing Two File Revisions (Versions)

From the Java Perspective (or other similar perspective), right mouse click on the changed file and select [Team Show Resource History]

The version history appears in the History Window.

Select the version you wish to compare with the current one. Right mouse click and select Compare with Current Revision.

Page 39: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 39

CVS and Eclipse :: Comparing Two File Revisions (Versions)

Java Source Compare window shows up both file versions and highlights the differences.

Page 40: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 40

CVS and Eclipse :: Branching with Eclipse and CVS

If you want to create an independent branch on which to work, right-click on the project name and select [Team Branch].

Page 41: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 41

CVS and Eclipse :: Branching with Eclipse and CVS

A Create Branch dialog box is displayed. Enter a branch name like “JUnitTesting_B1“. Leave the check box checked for Start working in the branch. Notice that a version name is automatically filled in for you

called "Root_ JUnitTesting_B1“. You may choose a different name (so long as it doesn't conflict

with an existing CVS tag). It will be used later by the merge editor to determine what has changed since branch creation.

Click OK.

Page 42: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 42

CVS and Eclipse :: Branching with Eclipse and CVS

You should be able to see the result of your branch in two ways: By right-clicking the project and selecting Properties and then

CVS, you should see the JUnitTesting_B1 in the tag field. In the CVS Repositories view expand the Branches node.

Page 43: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 43

CVS and Eclipse :: Merging - I

How to merge the changes done in a branch into another branch? The first step of the merge is to point the workspace to the target

branch. In our case, the target of the merge is the main branch. To switch the project contents to that of the main branch, right-

click on the JUnitTesting project in the Navigator view and select [Replace With Another Branch or Version].

You should see a branch selection similar to the one below.

Page 44: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 44

CVS and Eclipse :: Merging - II

The JUnitTesting_B1 branch is the one we were working on. To switch back to the main branch, select HEAD. This is the

CVS name for the main branch. The resource view should look like the one below. Notice the

version numbers correspond to what we committed. All the version numbers are two digits. The branch name is gone which implies the HEAD branch (or main).

Page 45: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 45

CVS and Eclipse :: Versioning - I

Eclipse supports different software releases via versioning. To create a new version of your application right-click on the

project name in the Navigator view and select [Team Tag as Version].

Page 46: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 46

CVS and Eclipse :: Versioning - II

Enter the version’s name.

The new version can be found in the CVS repositories under “Versions” node:

Page 47: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 47

Rational ClearCaseRational ClearCase

Page 48: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 48

Rational ClearCase :: Characteristics

ClearCase is a Software Configuration Management System from Rational Software at IBM Inc.

Feature Benefit

Sophisticated version control

Manage files, directories and other development assets across the lifecycle

Automated workspace management

Gain control over personal workspaces and enable seamless access to the exact files and directory versions that are needed

Page 49: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 49

Rational ClearCase :: Characteristics

Feature Benefit

Parallel development support including automatic branching and advanced merging and differencing technology

Work on the same code or release, more easily resolve conflicts, reduce confusion, and get more done in a short amount of time

Transparent, real-time access to files and directories

Fast access to virtually any version of any element

Support for disconnected usage

Continue development efforts while disconnected from the network, easily synchronize changes when reconnected to the network

Page 50: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 50

Rational ClearCase :: Characteristics

Feature Benefit

Activity-based change management

Define and manage related changes to assets as activities for improved insight and efficiency

Build and release management

Optimize build times, improve reproducibility of builds

IBM development support Provide unified enterprise application development

Local, remote (WAN) and Web client access

Access from the environments and locations from which developers work

Page 51: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 51

Rational ClearCase :: CharacteristicsFeature Benefit

Integration with leading IDEs including Rational Application Developer, Microsoft Visual Studio 2005 and others

Allow developers to work in their preferred environment

User authentication Control access to software assets

Audit trails Trace the origin and detail of changes made to software assets, help meet compliance requirements

Scalability from small workgroups to geographically distributed enterprises

Support evolving organizational needs

Integration with design, development, build, test and deployment tools

Manage and control software assets across the lifecycle

Page 52: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 52

Rational ClearCase :: ClearCase Development Environment - I

The development environment managed by ClearCase at its heart is a permanent, secure data repository.

It contains data that is shared by all users: this includes current and historical versions of source files, along with derived objects built from the sources by compilers, linkers, and so on.

In addition, the repository stores detailed “accounting” data on the development process itself: who created a particular version (and when, and why), what versions of sources went into a particular build, and other relevant information.

Page 53: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 53

Rational ClearCase :: ClearCase Development Environment - II

Only ClearCase commands can modify the permanent data repository. This ensures orderly evolution of the repository and minimizes the likelihood of accidental damage or malicious destruction.

Page 54: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 54

Rational ClearCase :: Views and Transparent Access

Users access the ClearCase data repository through views. A view is a software development work environment that is

similar to — but greatly improves on — a traditional “development sandbox”.

Each view can easily be configured to access just the right source data from the central repository:

the up-to-date versions for development of the next major release

the versions that went into the port of Release X.Y to hardware architecture Z

the versions being used to fix bug #ABC in Release D.E

Page 55: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 55

Rational ClearCase :: Views and Transparent Access

A view is an isolated “virtual workspace”, which provides dynamic access to the entire data repository. The changes being made to a source file in a particular view are invisible to other views.

Working in views, ClearCase users access version-controlled data using standard pathnames and their accustomed commands and programs.

A view can be accessed from any host in the local area network. For example, a distributed build involves execution of build scripts on several hosts at once, all in the same view.

Similarly, a view can be shared by several users, working on a single host or on multiple hosts. One user might “peek” into another's view, just to see what changes are being made.

Page 56: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 56

Rational ClearCase :: Version Control

The most basic requirement for a software configuration management system is version control — maintaining multiple versions of software development objects.

Traditional version-control systems handle text files only. ClearCase manages all software development objects: any kind

of file, and directories and links, as well. Versions of text and non-text files are also stored efficiently,

using data compression. Version control of directories enables the tracking of changes to

the organization of the source code base, which are just as important as changes to the contents of individual files.

Such changes include creation of new files, renaming of files, and even major source tree “cleanups”.

Page 57: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 57

Rational ClearCase :: Version Object Bases

ClearCase development data is organized into any number of versioned object bases (VOBs).

Each VOB provides permanent storage for all the historical versions of all the source objects in a particular directory tree.

As seen through a ClearCase view, a VOB seems to be a standard directory tree.

Page 58: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 58

Rational ClearCase :: Parallel Development - I

Each (sub)branch in an element's version tree represents an independent “line of development”.

This enables parallel development — creating and maintaining multiple variants of a software system concurrently.

Creation of a variant might be a major project (porting an application to a new platform), or a minor detour (fixing a bug; creating a “special release” for an important customer).

Page 59: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 59

Rational ClearCase :: Parallel Development - II

The overall ClearCase parallel development strategy is as follows: Establish a baselevel — Development work on a new variant

begins with a consistent set of source versions, identified (for example) by a common version label.

Use dedicated branches — All changes for a particular variant are made on newly-created branches with a common name.

Isolate changes in views — Development work for a particular variant takes place in one or more views that are configured to “see” the versions on the dedicated branches.

Page 60: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 60

Rational ClearCase :: Merging Branches

There is an additional important aspect of the ClearCase parallel development strategy.

Work performed on sub-branches should periodically be reintegrated (merged) into the main branch, the principal line of development.

ClearCase includes tools that automate this process.

Page 61: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 61

Version Control System Vendors :: Version Control System Software

Visual SourceSafe, Microsoft Perforce Serena Version Manager — previously Merant

PVCS TrueChange BitKeeper (was used in Linux kernel development

December 1999 - April 2005) Aldon Lifecycle Manager More on CM Crossroads: www.cmcrossroads.com

Page 62: CVS & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 26, 2006 by Emil Vassev & Joey Paquet revision 1.3 – Jan

CVS & Eclipse 62

CVS-Concurrent Versions System The official manual from http://www.cvshome.org

CVS Eclipse Plug-in FAQ CVS Howto - Eclipsepedia Eclipse Branching with Eclipse and CVS CVS--Concurrent Versions System v1.12.12.1 Version Control Systems, by Lee Reynolds Rational ClearCase Introduction to ClearCase

Resources