CVS Compare Overview

by Michela Frigerio
3,587 views Published on Oct 24, 2011
Applies to: All versions
Table of contents

Introduction

WebRatio allows to compare a Web Project in your workspace with other Web Projects. You can perform the compare operation in two different ways:

  • You can compare two Web Projects in your workspace, doing a local comparison. In this case you can perform different comparisons using different commands
    • Compare With > Each Other. This command compares two or three selected Web Projects with each other.
    • Compare With > Local History. This command compares the selected Web Project to one that is in the local history, which is maintained when you save changes. (Tip: to configure the size and depth of your local history, select Window -> Preferences, select the General > Workspace > Local History section and change the settings you desire).
  • You can compare a Web Project with the latest version committed on the CVS repository to which the project is connected. In this case you are doing a synchronization
    • Compare With > Latest from HEAD. This command compares the selected resource with the version of the same resource that is currently committed to the active branch. This option is available for CVS. This, or a similar option, may not be available for other repository types.
    • Compare With > Another Branch or Version. This command compares the selected Web Project with a version that has been committed to the repository or to the latest version in a particular branch. This requires you to choose a version of the resource or a branch from a list. This option is available for CVS. This, or a similar option, may not be available for other repository types.
    • Compare With > History.... This command compares the selected Web Project with a version of the same Web Project that was committed to the active branch. This action will open the History View in compare mode. You will then be able to choose which revision you wish to compare by double clicking on a revision in the History View. This option is available for CVS. This, or a similar option, may not be available for other repository types.

When a comparison is performed, comparison editors appear in the editor area. The differences between files are highlighted in the comparison editors, allowing you to browse and copy changes between the compared resources.

  • If you use one of the previous commands on the entire Web Project, the tool will show you the Team Synchronizing Perspective. In this perspective you see the Synchronize View which lists all the changed resources. In order to compare a single resource and open the corresponding compare editor you have to double click on the resource. For the "Model.wr" file, which is the main Web Project file, there is a special compare editor.
  • If you use one of the previous commands directly on the "Model.wr" file, the tool opens immediatly the specific compare editor.

In the first case, it could happen that Eclispe shows the Model.wr as a conflictual resource. This is due to the syntactical nature of the comparison made by Eclipse. Actually, the WebRatio compare editor makes a semantic comparison between the local and the remote "Model.wr" file. For this reason you have always to check if the Model.wr file is really conflicting by using the WebRatio Compare Editor. Once you checked the changes and you decided that the resource is ready to be committed, you have to perform another operation first. Eclipse does not allow you to commit conflicting files. For this reason you have to select the file and choose the Mark as Merged command from the context menu. After that you can commit the file.

The WebRatio Compare Editor

After a comparison is carried out, the WebRatio Compare Editor opens in the editor area. In the WebRatio Compare Editor, you can browse through all the differences and copy highlighted differences between the compared Web Projects. You can save changes to Web Projects that are made in the WebRatio Comparison Editor.

Here is how the WebRatio Compare Editor looks like.

 

Synchronization state

When you choose to compare two "Model.wr" files the tool opens the WebRatio Compare Editor. It is organized in different parts. At the top of the editor you can see the structural tree of your Web Project. This tree shows only the elements that have been changed. Moreover it shows the synchronization state of each element in your Web Project tree compared to those in the repository Web Project. This state is shown by using icons. Here it is a description of the possible states:

  • Elements that you have not changed but another member of the team modified and committed are shown as input changes ( ):
    • New input elements are marked with the icon.
    • Removed input elements are marked with the icon.
  • Elements that you changed and anyone else in the team didn't, are shown as output changes ( ):
    • New output elements are marked with the icon.
    • Removed output elements are marked with the icon.
  • Elements that both you and another team member changes are shown as conflictual changes ( ).

Tree Navigation

There are two command that allows to navigate the Web Model tree.

  • Select Next Difference ( ). Highlights the next difference that is found between the compared resources.
  • Select Previous Difference ( ). Highlights the previous difference that is found between the compared resources.

Mode

The WebRatio Compare Editor can be filtered using modes throught the toolbar actions at the top right of the Web Project tree. Modes can be used to show only incoming, outgoing or conflicting changes. The advantages to modes are:

  • They support and encourage the ideal work flow.
  • They reduce the amount of information you are faced with at any one time.
  • They provide a degree of safety restricting you to those operations appropriate to that mode. For example, you can't accidentally commit a conflict when in incoming mode.

The available modes are:

  • Incoming Mode ( ). In this mode, only resources which have been changed in the repository since they were last loaded or synchronized with those in the Workbench (incoming changes) are visible.
  • Outgoing Mode ( ). In this mode, only resources which have been modified in the Workbench (outgoing changes) are visible.
  • Incoming/Outgoing Mode ( ). In this mode both incoming and outgoing changes are shown, and you can both update and commit. The advantage to using this dual mode is you can do either task as you choose. The disadvantage is that performing a simultaneous bi-directional merge is often complicated.
  • Conflicts Mode ( ). In this mode only conflicts (resources modified both in the Workbench and in the repository) are shown.

The Ignore White Spaces option

The WebRatio Compare Editor consider all the aspects of the Web Project. In particular it consider also the position of each element in the workarea. For this reason, it can frequently happen that some changes regard only the element position. If you want to ignore this aspect you have to press the "Ignore White Spaces" button. The tree in the compare editor automatically reloads showing the "real" changes in the Web Project. You can also set this option as default following these steps:

  1. Select Window -> Preferences.. from the main menu.
  2. Open the General -> Compare/Patch preference page in the dialog.
  3. Check the "Ignore White Spaces" property.
  4. Click on the "Apply" button and then on the "OK" button.

The Toolbar

The toolbar of the WebRatio Compare Editor includes the following buttons:

  • Control Visibility of Ancestor Pane ( ). There are two conditions under which a three way compare will occur, both when using the Team version management support: when comparing a file that is in conflict, and when comparing a file being merged from a branch. In both cases, the system will determine a common ancestor in the repository to compare the conflict or merge against. This button determines the visibility of the third editor. By default, the ancestor pane is not visible.
  • Copy All from Left to Right ( ). Copies the entire contents of the file in the left pane into the file in the right pane, making the contents of the two files identical.
  • Copy All Non-Conflicting Changes from Right to Left ( ). Copies all the non-conflicting changes from the right pane into the left pane. Conflicting changes must be copied individually.

There are other two commands that are available in the left and right panes:

  • Copy Current Change from Left to Right ( ). Merges changes in two files by copying the highlighted change in the left pane into the highlighted fragment on the right. This will overwrite the highlighted fragment in the right pane.
  • Copy Current Change from Right to Left ( ). It does the opposite of the one just described.

The Context Menu

From the context menu of the WebRatio Compare Editor you can perform three operations:

  • Expand All. This command expands all of the selected element's children in the Web Project tree.
  • Remove From View. This command removes the selected elements from the view. The elements will only reappear if the state of the removed elements changes or the Workbench is restarted.
  • Override and Update. This command operates on conflicts and outgoing changes and replaces the local contents of those elements with the contents from the server.

Undo and redo compare

When comparing projects it is possible you make a mistake importing nodes or properties. There are two commands that permit to undo or redo the most recent operations.

  • Undo( ): permits to undo the most recent operation including the Remove From View.
  • Redo( ): permits to redo the most recent operation including the Remove From View.

Export Compared Projects

When problems occur in comparing project you can export the projects that you are currently comparing. The Export ( ) command creates a ".zip" file containing the project files used in the compare. In this way it is possible to exactly replicate the situation that causes your problems.

 
 

Related Learning Objects