O/R Mapping
Mac OS X
Tips and Tricks
UML Diagrams
VP Suite
Change Log

Branch and Tag Support in CVS

CVS (Concurrent Versions System) is a popular version control system that stores artifacts centrally and keeps track of changes and histories. VP products can talk to CVS repository directly to provide revision control and collaboration functionalities. You can import projects, commit and update your modeling project to the CVS repository. If there is more than one team member modifying the same set of models at the same time, you can also resolve conflicts with the assistance of the comprehensive conflict resolution UI.

Other than primitive revision control and collaboration, you can also manage your modeling project with branches and tags. Tags are used to mark milestones or release-quality projects, so used to keep your work isolated from any changes. Branches are separate lines of development isolated from the main line, to avoid making unstable changes to the main line. Once the changes are stable enough the branch can be merged back into the main project (the head). Branching from a project can keep the modeling going on while the core project is kept stable.

Importing a Project

Animated Demo

To start modeling collaboratively, you need to use Teamwork Client to import the project to the CVS Repository. Open the Teamwork Client via Tools> Teamwork> Open Teamwork Client...

The login dialog box will appear. Select ‘CVS’ from the drop-down menu, fill in the login details and click OK.

The ‘Manage Project’ dialog box will appear. As we are creating a new project we do not need to select a repository. Click Cancel to proceed.

Import a project to the repository by selecting Project> Import Project to Repository

The import project box will appear. Create a remote folder by right-clicking and select ‘New Remote Folder’.

Enter the name and a comment for the folder and click OK.

Select a folder for containing the new project. Enter the name of the project and select ‘Create New Project’. It is also possible to use a currently opened project as the source or import it from an external project. When you have checked your settings, click OK.

The project will be checked out automatically

Managing a project in the Teamwork Client

Animated Demo

First connect to the CVS repository (see steps above). Then open the ‘Manage Projects’ dialog box using Project> Manage Project

To manage a project select a project node and click the ‘>’ button to add it to the projects list.

To discard a managing project just select it and click the ‘<’ button to remove it from the list.

When you are satisfied with your list click OK to confirm.

Checking out a Project

Animated Demo

Checking out a project from the repository means to copy the project from the repository into your local drive. Select a project to check out and click the ‘Checkout’ button in the bottom right corner.

The project is now checked out into your local drive. You can open it in VP-UML by click ‘Open Project’. Clicking ‘Open Project’ without checking out will automatically check out the project before opening it.

Committing Changes to the Repository

Animated Demo

Let’s have a look at our modified project.

To commit it to the repository select Tools> Teamwork> Commit.

Committing can also be done by clicking the ‘Commit’ icon in the toolbar or right-clicking a project node in a tree and selecting Teamwork> Commit from the pop-up menu.

Enter a comment for the project commit and press OK.

The ‘Commit Model(s)’ box list of modifications that will be committed to the server. Click OK to proceed committing.

Updating Changes to the Repository

Animated Demo

To update changes from the repository select Tools> Teamwork> Update.

The ‘Update Model(s)’ dialog box lists all the changes that will updated to your project. Click OK to proceed.

The changes made by other team members will be brought to your copy.

Branching and Tagging a Project

Branches are tags are quite similar things, but with different purposes. Tags are used to mark milestones or release-quality projects, to keep your work isolated from any changes and are therefore rarely modified. Branches are for when modeling activities will be carried out that may make the project unstable, but can always merge back to the head, or vice versa.

Creating a Branch

Animated Demo

To create a branch or tag first connect to the CVS repository (please refer to section above). Select a project from the Projects list where you want to create a branch and click Projects> Branch from the menu.

Enter the branch name and select the action you want to take after creating the branch. By selecting “Stay in head”, it will stay at the head. Selecting “Start working in branch”, it will checkout and switch to the branch, while “Check out branch” will download the branch to the local drive, but stay at the current head. We will select “Stay in head”.

Click OK to continue. The branch is now created.

Creating a Tag

Animated Demo

To create a tag for a project connect to the CVS repository and select the project you want to add a tag to from the Projects list. Select Projects> Tag from the menu.

Enter a tag name and select the action you want to take after creating the tag. As with the branches, selecting “Stay in head”, will stay at the head. Selecting “Start working in tag”, it will checkout and switch to the tag, while “Check out tag” will download the tag to the local drive, but stay at the current head. We will select “Stay in head”.

The tag is now created.

Suggested Branch Usage

Here is an example of how branches might be used in CVS.

Merge Changes from head to Branch

Animated Demo

From time to time the head of the project may keep modifying, for instance, to fix modeling issues. You can bring the changes from the head into a branch by using the Merge function. This is the branch project. The color of its classes has been modified to orange.

To merge to the branch select Tools> Teamwork> Merge.. and a dialog box will show.

Enter the path you want to merge from. By default this path is set to the head. Press OK.

The ‘Merge Project’ box will show the changes that will be merged to the branch. Click OK to continue.

After the merging is complete it will automatically start to commit the changes made in the local copy to the repository. Enter a comment, and press OK to continue.

Click OK again in the ‘Commit Model(s)’ dialog box.

The changed are merged and committed. In this example the ‘TransactionType’ class has been added from the head to the branch for further formatting improvement.

Merge Changes from Finished Branch to Head

Animated Demo

After a branch is finished, you can merge all the work from the branch back to the head. Before merging from branch to head, please make sure all head work has been merged to the branch. After merging a finished branch back to the head, the branch will usually be deleted.

We are now in the head of the project.

Let’s merge the ‘Improve-Formatting’ branch back to the head. Select Tools> Teamwork> Merge...

From the Merge dialog box, select the branch to merge from, and click OK.

The ‘Merge Project’ dialog box will show all the changes that will be merged back into the head. Click OK.

It will automatically ask you to commit the changes. Select OK to continue and commit.

The head is now modified as the changes made in the branch are merged into the head.

Normally no more changes are made to a branch after it has been merged back to the head. In this case you are advised to delete the branch altogether.

Deleting a Branch

To delete a branch, open the Teamwork Client and select Project> Delete Branch.. from the menu.

From the Remove Branch dialog box, select the .vpp file of the branch to be removed and click Select.

Enter a comment in the dialog box and click OK to delete the branch.

Resources

 
 
Last modified: 2007/08/01 21:19
 
 
Home | Recent Topics | Highlights | UML Diagrams | Tips and Tricks | Object-Relational Mapping
visual-paradigm.com Home | Training Center | UML Center | VP Gallery | Discussion Forum | UML Open Directory