New Features
Enhanced Features
O/R Mapping
Tips and Tricks
UML Diagrams
VP Suite

Branch and Tag Support in Perforce

Perforce is a Software Configuration Management system which let developers manage the changes they made when developing software. VP products can talk to Perforce directly to provide revision control and collaboration functionality. You can import projects, commit and update you modeling project to the Perforce repository. If them is more than one team member modifying the same set of model 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 projects with branches and tags. Branches are separate lines for development isolated from the main line, to avoid making unstable changes to the main lone. Once the changes are stable enough, the branch can be merged back into the main project(the trunk). Branches from a project can keep a model going on with the core project is keep stable. Tags are marked for milestone or release-quality projects, so used to keep your work isolated from any changes.

Importing a project into the Repository

  1. Select Tools > Teamwork > Open Teamwork Client... from the main menu (or click on the Open Teamwork Client button on the tool bar).


  2. This shows the Login to the Teamwork Server dialog box. Select Perforce as the server and enter the fields. Then click OK to connect to the server.


    Field Description
    User name The name of user under which to connect
    PasswordPassword for user
    Perforce path The path of the p4.exe file
    Host The address of the host (ip / host name)
    Port The port number assigned to the Perforce server


  3. Since we are going to create a new project, there is no need to select a project, click Cancel to proceed.


  4. In the Teamwork Client dialog box, select Import Project to the Repository (or click on the Import Project to the Repository button on the tool bar).


  5. This shows the Import Project dialog box. To create a new project, select the folder for containing the project.


  6. Enter the project name and select the source of the project file. We will create a new one. It is also possible to use the currently opening file to be the source, or import from an external project.


  7. Click OK when it is done.

Managing a project in the Teamwork Client

  1. Follow the first three steps shown in the above section to connect to Perforce Repository.
  2. In the Teamwork Client dialog box, select Manage Project (or click on the Manage Project button on the tool bar).


  3. This show the Manage Project dialog box. To manage project, select a project node and press the Add Selected button ( > ) to add it to the Projects list.


  4. To discard managing a project, select a project from the Projects list and press the Remove Selected button ( < ) to remove it from the Projects list.


  5. Click OK to confirm.

Checking out a Project

By importing a project to the server, clients can check that out from the Perforce server to the local drive.

  1. Select a project from Projects list in the Teamwork Client dialog box.


  2. Click Check out.


    The details of the project will be shown in the Project Details pane.


  3. After the project is checked out, you can open it in VP. To do so, simply click Open project.


Committing Changes to the Repository

At certain point of time, we can commit the project to the server in order to store the local changes made in the project to the server.

Let’s create a Use Case Diagram.


  1. Select Tool > Teamwork > Commit..., there are also two possible ways:
  2. Click on the Commit button on the tool bar
  3. Right-click on the project node of various tree (e.g. tree in diagram navigator) and select Teamwork > Commit... from the popup menu.


  4. Enter description in the Commit Project dialog box and click OK.


  5. The Commit Model(s) dialog box lists the changes that will be committed to the server. Click OK to proceed.


Updating Changes from the Repository

When we want to get the changes made by other team members to the local project, we can run the Update function.

  1. Select Tool > Teamwork > Update (or click on the Update button on the tool bar)to update the project from the server.


  2. The Update Model(s) dialog box lists the changes that will be updated to the local project copy. Click OK to proceed.


  3. The changes made by other team members are brought to the local project copy.


Branching and Tagging a Project

Branch and Tag 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 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 trunk, or vice versa.

Creating a Branch

  1. Follow the first three steps shown in the section of Importing a Project to Perforce Repository.
  2. Select the project from the Projects list in the Teamwork Client dialog box to create branch.


  3. Select Project > Branch... (or click on the Branch button on the tool bar).


  4. Enter branch name.


    Select the action after the branch created. We will select Stay in trunk.


    Action Description
    Start working in branch Check out and switch to the branch
    Check out branch Download the branch to the local drive, but keep staying at the current branch, trunk or tag
    Stay in trunkStay at the current branch, trunk or tag
  5. Click OK. It may ask if you want to create the URL, press Yes to proceed.
  6. The branch is created.

Creating a Tag

  1. Follow the first three steps shown in the section of Importing a Project to Perforce Repository.
  2. Select the project from the Projects list for creating tag.


  3. Select Project > Tag... (or click on the Tag button on the tool bar).


  4. Enter tag name.


    Select the action after the tag created. We will select Stay in trunk.


    Action Description
    Start working in tag Check out and switch to the tag
    Check out tag Download the tag to the local drive, but keep staying at the current branch, trunk or tag
    Stay in trunkStay at the current branch, trunk or tag
  5. Click OK. It may ask if you want to create the URL, press OK to proceed.
  6. The tag is created.

Merge Changes from Trunk to Branch

From time to time the trunk may keep modifying. The reason can fix some modeling issues. You can bring the change from Trunk to branch by using the merge function. Here is the branch. The color of use cases are modified.


On the other hand, the trunk user has just added several use cases. Let’s merge the trunk to branch to bring the changes made in trunk.

  1. Select Tool > Teamwork > Merge... (or click on the Merge button on the tool bar).


  2. This shows the Merge dialog box. Enter the path to merge from. By default, the path of trunk is presented. It is possible to choose another one. But this time, we just keep the path as is.


  3. Click OK.
  4. This shows the Merge Project dialog box which shows the changes that are made in trunk and will be merge to the branch. Click OK to proceed.


  5. After the merge is done, it will commit the changes made to the local copy to the repository. Click OK when th Commit Project dialog box is shown.


  6. The changes are merged. In this case, the change of formatting done in the trunk is brought to the branch.


  7. The user can keep on with the modification.

Merge Changes from Finished Branch to the Trunk

After the Branch is done, you can merge all the work from Branch to Trunk. Before merge from Branch to Trunk, please make sure that all Trunk work are merged to Branch. The Branch should be deleted after merging. Here is the Trunk. Let’s merge the branch for improving formatting back to trunk.

  1. Select Tool > Teamwork > Merge... (or click on the Merge button on the tool bar).


  2. This shows the Merge dialog box. Press ... next to the path field to select the path to merge from branch.


  3. From the Repository Browser, select the .vpp file of the branch and click OK.


  4. The Merge Project dialog box shows the changes that are made in branch and will be merged to the trunk. Click OK to continue.


  5. After the merging is done, it will commit the changes made to the local copy to the repository. Click OK in the Commit Project dialog box.


  6. Press OK in the Commit Model(s) dialog box.


  7. The changes are merged. In this case, the change of formatting done in the branch is brought to the trunk.


Deleting a Branch

Normally, no development activities should be done in a branch after it is being merged to the trunk. In such case, you are suggested to delete the branch.

  1. Select Tool > Teamwork > Open Teamwork Client (or click on the Open Teamwork Client button on the tool bar).


  2. From the Teamwork Client dialog box, select Project > Delete Branch... from menu.


  3. From the Delete Branch dialog box, select the .vpp file of the branch to be removed. You may enter the comment for the deletion. Click OK when it is done.


Resources

 
 
Last modified: 2007/12/03 21:47
 
 
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