| <?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| <title>Getting Started</title> |
| <link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.emf.compare.doc/doc/resources/bootstrap.css"/> |
| <link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.emf.compare.doc/doc/resources/custom.css"/> |
| </head> |
| <body> |
| <h1 id="Getting_Started">Getting Started</h1> |
| <h2 id="Installing_EMF_Compare">Installing EMF Compare</h2> |
| <p> |
| <b>Marketplace Client</b> |
| </p> |
| <p>Using the bundled Eclipse marketplace client you can install EMF Compare in one click. Just type "emf compare", click on search, and then on install. </p> |
| <p> |
| <img border="0" src="./../images/Marketplace.png"/> |
| </p> |
| <p> |
| <b>Update Site</b> |
| </p> |
| <p>EMF has been part of the Eclipse release train since Galileo, you can install it using the following update sites, depending on your platform. |
| <b>Note</b> that the following are not meant to be visited in your internet browser; they must be pasted in the |
| <i>Help > Install New Software</i> dialog of your Eclipse, as p2 repositories. |
| </p> |
| <pre> http://download.eclipse.org/releases/juno |
| http://download.eclipse.org/releases/indigo |
| http://download.eclipse.org/releases/helios |
| http://download.eclipse.org/releases/galileo |
| </pre> |
| <p>The |
| <a href="http://www.eclipse.org/emf/compare/downloads/">Download page</a> lists more specific update sites if you wish to try one of the latest integration builds. |
| </p> |
| <p> |
| <b>Compatibility</b> |
| </p> |
| <p>Please note that the EMF Compare development team does its best to maintain downward compatibility towards Galileo (Eclipse 3.5). Following is the compatibility chart : </p> |
| <table border="1"> |
| <tr> |
| <th>EMF Compare </th> |
| <th bgcolor="#cccccc" align="center">Eclipse 4.3 - EMF 2.9</th> |
| <th align="center">Eclipse 4.2 - EMF 2.8</th> |
| <th align="center">Eclipse 3.8 - EMF 2.8 </th> |
| <th align="center">Eclipse 3.7 - EMF 2.7 </th> |
| <th align="center">Eclipse 3.6 - EMF 2.6 </th> |
| <th align="center">Eclipse 3.5 - EMF 2.5 </th> |
| <th align="center">Eclipse 3.4 - EMF 2.4</th> |
| <th align="center">Eclipse 3.3 - EMF 2.3</th> |
| <th align="center">Eclipse 3.2 - EMF 2.2 </th> |
| </tr> |
| <tr> |
| <td bgcolor="#cccccc" align="center">2.1</td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#9d261d"> </td> |
| <td bgcolor="#9d261d"> </td> |
| <td bgcolor="#9d261d"> </td> |
| </tr> |
| <tr> |
| <td align="center">2.0</td> |
| <td bgcolor="#ffffff"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#9d261d"> </td> |
| <td bgcolor="#9d261d"> </td> |
| <td bgcolor="#9d261d"> </td> |
| </tr> |
| <tr> |
| <td align="center">1.3</td> |
| <td bgcolor="#9d261d"> </td> |
| <td bgcolor="#9d261d"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#9d261d"> </td> |
| <td bgcolor="#9d261d"> </td> |
| <td bgcolor="#9d261d"> </td> |
| </tr> |
| <tr> |
| <td align="center">1.2 </td> |
| <td bgcolor="#ffffff"> </td> |
| <td bgcolor="#ffffff"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#9d261d"> </td> |
| <td bgcolor="#9d261d"> </td> |
| </tr> |
| <tr> |
| <td align="center">1.1 </td> |
| <td bgcolor="#ffffff"> </td> |
| <td bgcolor="#ffffff"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#9d261d"> </td> |
| <td bgcolor="#9d261d"> </td> |
| </tr> |
| <tr> |
| <td align="center">1.0 </td> |
| <td bgcolor="#ffffff"> </td> |
| <td bgcolor="#ffffff"> </td> |
| <td bgcolor="#ffffff"> </td> |
| <td bgcolor="#ffffff"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#46a546"> </td> |
| <td bgcolor="#9d261d"> </td> |
| </tr> |
| </table> |
| <p>An empty cell indicates that the compatibility hasn't been tested for a particular combination.</p> |
| <h2 id="User_Interface_Breakdown">User Interface Breakdown</h2> |
| <p>The main points of interest are highlighted in the following picture :</p> |
| <p> |
| <img align="middle" title="EMF Compare's basic user interface" alt="EMF Compare's basic user interface" border="0" src="./../images/CompareUI.png"/> |
| </p> |
| <ol> |
| <li>Overview of the differences detected between the given two (or three) models.</li> |
| <li>First version of the compared models.</li> |
| <li>Second version of the compared models.</li> |
| <li>This button will only be visible in the case of three-way comparisons (for example, comparing with a remote repository). It will make a third version of the compared model (the common ancestor of the two others) visible in the interface.</li> |
| <li>This button will allow you to group differences together in the structural view. For example, grouping all "Additions" or "Deletions" together.</li> |
| <li>This button will allow you to filter some differences out of the view according to a set predicate. For example, filtering out all "Additions" or "Moves".</li> |
| <li>Allows you to merge all non conflicting differences (left to right, or right to left) at once.</li> |
| <li>Allows you to merge the single, currently selected difference in a given direction (left to right, or right to left).</li> |
| <li>Allows you to navigate through the detected differences.</li> |
| </ol> |
| <h2 id="Usage">Usage</h2> |
| <p>Once installed, you can compare your files (locally or from any Version Control System) as usual using the |
| <b>compare with</b> menu. |
| </p> |
| <p> |
| <img align="middle" border="0" src="./../images/EMFC_Compare_With.png"/> |
| </p> |
| <p>The following displays the important part of a model life cycle with regards to the comparison. The full life cycle can be followed on |
| <a href="./Sample%20Use%20Case.html" title="./Sample%20Use%20Case.html">Sample Use Case</a> |
| </p> |
| <h3 id="Compare_with_latest">Compare with latest</h3> |
| <p>For this test, we'll suppose that you are trying to use EMF Compare on UML models shared under git. This will not go in details about UML and Git. We'll assume that you know how to manipulate an UML model, create or clone a git repository, share a project under it and use standard Git operations.</p> |
| <p>The name of our sample project will be "library". It contains a single folder "model" containing two models :</p> |
| <ul> |
| <li>library_Types.uml will contain our primitive types,</li> |
| <li>library.uml will contain our actual model.</li> |
| </ul> |
| <p>The model itself is a very simple library. Graphically speaking :</p> |
| <p> |
| <img border="0" src="./../images/EMF_Compare_Use_Model.png"/> |
| </p> |
| <p>We commit this initial file as the original model. We then slightly modify it so that it now looks like :</p> |
| <p> |
| <img border="0" src="./../images/EMF_Compare_Use_Model_Changed.png"/> |
| </p> |
| <p>But how do we know exactly what changed? Let's compare this with the file from the Git Index :</p> |
| <p> |
| <img border="0" src="./../images/EMF_Compare_Use_Compare_1.png"/> |
| </p> |
| <p>This will open a comparison editor that initially displays empty panels on its bottom half. Let's select one of the differences displayed on its top half :</p> |
| <p> |
| <img border="0" src="./../images/EMF_Compare_Use_Compare_3.png"/> |
| </p> |
| <ol> |
| <li>We've selected the difference corresponding to the addition of attribute |
| <b>alias</b> in the class |
| <b>Writer</b>. A double-click on this difference updated our two panes below. |
| </li> |
| <li> |
| <b>alias</b> has been added to the properties of Class |
| <b>Writer</b>. In the model, this corresponds to a change to the reference |
| <i>ownedAttributes</i> of the |
| <i>Writer</i> Class. This sub-panel indicates the actual reference that was changed in oder to remind us of the context. |
| </li> |
| <li>This displays all values of the reference outlined in (2) as they are in the |
| <i>left</i> model. This is where we see the new value, |
| <b>alias</b> outlined. |
| </li> |
| <li>As for (2), this will display the context of the selected difference. The same reference will usually be displayed in both (2) and (4).</li> |
| <li>This panel displays all values of the reference outlined in (4) as they are in the |
| <i>right</i> model. In here, we see the location of |
| <b>alias</b> outlined as an empty space. This rectangle is where the new value will be added if we merge it... Though in this case, it is not possible to merge towards the |
| <i>right</i> : it is a version located on a repository and is thus non-editable. |
| </li> |
| </ol> |
| <p>This is useful in order to determine exactly what changed in our version, but serves no other purpose : merging changes here would only mean reverting back our modifications to the "clean" state from the repository. Let's commit our changes on the |
| <i>master</i> branch. |
| </p> |
| <h3 id="Compare_two_differing_branches">Compare two differing branches</h3> |
| <p>After that, our model can evolve, and evolve separately in multiple branches. Let's consider the case where we would have a |
| <i>master</i> branch differing from a |
| <i>borrowables</i> branch such as the two look like this (the branching point was the model we've already displayed above) : |
| </p> |
| <table border="1" cellpadding="5" cellspacing="0"> |
| <tr> |
| <th align="center">Master</th> |
| <th align="center">Borrowables</th> |
| </tr> |
| <tr> |
| <td> |
| <img align="middle" border="0" src="./../images/EMF_Compare_Use_Compare_Master.png"/> |
| </td> |
| <td> |
| <img align="middle" border="0" src="./../images/EMF_Compare_Use_Compare_5.png"/> |
| </td> |
| </tr> |
| </table> |
| <p>Before we continue working on our Borrowables branch, we'd like to retrieve all modifications that have been pushed to master. With the "Borrowables" branch checked out, we'll use the |
| <i>Compare With > Branch, Tag or Reference</i> action : |
| </p> |
| <p> |
| <img align="middle" border="0" src="./../images/EMF_Compare_Use_Compare_With_Master_1.png"/> |
| </p> |
| <p>and compare with master :</p> |
| <p> |
| <img align="middle" border="0" src="./../images/EMF_Compare_Use_Compare_With_Master_2.png"/> |
| </p> |
| <p>This shows us all differences between our local copy and the master branch that were made since the 'branching' point.</p> |
| <p> |
| <img align="middle" border="0" src="./../images/EMF_Compare_Merge.png"/> |
| </p> |
| <p>Same as previously, you can navigate through the differences via the top panel, the structural view. There are three main kind of elements displayed here. |
| <b>Regular</b> elements, that mimic the containment tree of your input models, are there to separate the various differences and let you know where they were actually detected. Then there are |
| <b>incoming</b> differences, decorated with a blue arrow ( |
| <img border="0" src="./../images/EMF_Compare_Incoming_Change.gif"/>) or a derived icon, and |
| <b>outgoing</b> differences decorated with a green arrow ( |
| <img border="0" src="./../images/EMF_Compare_Outgoing_Change.gif"/>) or a derived icon. |
| </p> |
| <p> |
| <b>Incoming</b> differences are changes that were made in the remote branch (here, |
| <i>master</i>) since the branching point (common ancestor). |
| |
| <b>Outgoing</b> differences are changes taht were made in the local copy (here, the |
| <i>borrowables</i> branch) since the branching point. |
| </p> |
| <p>There are no conflicts here, since UML uses computed identifiers (XMI ID) for the model elements. Thus, what looks like a conflict (the "Date" type that's been added on both branch in the types packages) is actually two distinct differences.</p> |
| <p>The interface also lets you display the common ancestor of both models through the |
| <img border="0" src="./../images/EMF_Compare_Ancestor.gif"/> icon. For example, if we select the |
| <b>Book</b> class, we can see how it looks like on all three versions : |
| </p> |
| <p> |
| <img align="middle" border="0" src="./../images/EMF_Compare_Merge_Book_Ancestor.png"/> |
| </p> |
| <p>You can navigate through the differences using the appropriate actions, either the previous ( |
| <img border="0" src="./../images/EMF_Compare_Prev_Diff.gif"/>) or the next ( |
| <img border="0" src="./../images/EMF_Compare_Next_Diff.gif"/>) difference. |
| </p> |
| <p>The remaining two actions are those that actually interest us here we can either merge all non-conflicting differences to the local copy through |
| <img border="0" src="./../images/EMF_Compare_Copy_All.gif"/> or merge them one after the other through |
| <img border="0" src="./../images/EMF_Compare_Copy.gif"/>. |
| </p> |
| <p>Merging |
| <b>all</b> differences is not what we seek : we want to keep the changes we made locally, not revert them to the state they had before the branching point (which is their current state on |
| <i>master</i>, the right side). We will then select all |
| <i>incoming</i> differences one after the other and merge them one by one. This gives us our merged model : |
| </p> |
| <p> |
| <img align="middle" border="0" src="./../images/EMF_Compare_Merged.png"/> |
| </p> |
| <p>Notice that |
| <i>merged</i> differences are displayed in |
| <i>italics</i> and have a distinct icon. All that's left is to save, our model now contains both our local changes and the changes that were made on master. |
| </p> |
| </body> |
| </html> |