Skip to main content
summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2015-03-02[458147] Apply three-way merging also for rejecting attribute changesPhilip Langer1-24/+269
Bug: 458147 Change-Id: I7ca592c1de713f99157e19593d05fd4e71775d80 Signed-off-by: Philip Langer <planger@eclipsesource.com>
2015-03-02[460675] Fix differences for noncontained FeatureMapEntries with movedStefan Dirix6-2/+80
values Fixes the calculation of differences in scenarios where a non-contained entry is added to (or removed from) a FeatureMap and its reference is simultaneously moved. Includes testcases. Bug: 460675 Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Change-Id: I0c10a907f3bf3d2aaf857ac799cbe81967d23249
2015-03-02[460923] Do not filter FeatureMapChanges on removed ElementsStefan Dirix4-2/+77
The DefaultDiffEngine tries to minimize the number of calculated differences. This fix modifies the DefaultDiffEngine to allow calculation of FeatureMapChanges on removed elements. This is needed to prevent ordering issues when contained elements are added back via right-to-left merges. Includes testcase. Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Change-Id: Ia119ed2bf98a2730aa74c343e9138ed4bd82d35e
2015-03-02[460902] Fix Dependency Calculation for FeatureMap Add and DeleteStefan Dirix4-2/+71
The DefaultDiffReqEngine did not properly consider FeatureMapChanges when calculating the requirements between ReferenceChanges and FeatureMapChanges concerning Add and Delete operations. Includes testcase. Bug: 460902 Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Change-Id: Id7553e88d2caf09990f797fb8466c698f0d780c5
2015-02-18[452147] Fix handling of diffs for interlocked one-to-one refsStefan Dirix6-4/+145
Every difference describes an effect which modifies the model. In a model with interlocked one-to-one references merging a difference can implicitly execute the effect of other differences without being equivalent to them. These differences are added to the directResultingMerges of the AbstractMerger. This patch also modifies the determination of equivalences for the described case in the DefaultEquiEngine. Includes testcases. Bug: 452147 Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Change-Id: I8741885c45736f82e2442a32843f7d0afbaf9a67
2015-02-06[457034] ProximityEObjectMatcher should support cancellationLaurent Delaigue6-3/+619
Improved monitoring by making use of SubMonitor and supporting cancel where it makes sense. Also added dedicated unit tests. Didn't want to break the API so added TODOs instead... Bug: 457034 Change-Id: I92dc82e2217c0cce818fb3d95a545f38f97bc86b Signed-off-by: Laurent Delaigue <laurent.delaigue@obeo.fr>
2015-01-21[456860] Improve handling of equivalent three-way text changesPhilip Langer1-13/+303
Three-way diffing and patching is not supported by google diff match patch (dmp) and simply applying the patch computed by dmp to the opposite side, as we did before, would cause the equivalent changes to be applied twice. Therefore, we had to re-implement the detection and merging ourselves to support the handling of equivalent changes. We also adapted the test cases and the implementation of the three-way diff and merge to correspond to the behavior of the org.eclipse.compare line differencing and introduced a determination of the currently used line separator in the text, which is now also used when building the merged version. Bug: 456860 Change-Id: I12be9c68eda663e0206c9f230a9faf9631be3275 Signed-off-by: Philip Langer <planger@eclipsesource.com>
2014-12-17[453218] Add missing FeatureMapChanges concerning MovesStefan Dirix4-7/+169
Fixes the DefaultDiffEngine to also add FeatureMapChanges of DifferenceKind.MOVE where the corresponding element resides in a Non-FeatureMap-Containment in the left-hand-side while residing in a FeatureMap-Containment in the right-hand-side. Also modified are the DefaultEquiEngine to properly detect equivalences concerning the new diffs and the FeatureMapChangeMerger to correctly merge the new diffs. Includes testcases. Bug: 453218 Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Change-Id: I1a9721ce3265d43f2b97a0f992ff6915731fbcf1
2014-12-16[455255] Fix determination of TargetFeature in DiffUtilStefan Dirix5-2/+64
The method getTargetFeature in DiffUtil is fixed to return the correct feature when the DifferenceSource is RIGHT. This avoids ordering issues as well as NullPointer Exceptions. Includes a testcase. Bug: 455255 Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Change-Id: Ie2b4e744cec5d297461f6a9c9127b9400a24d10a
2014-12-16Adds unit test for enum3.1.0M4Arthur Daussy15-0/+611
Adds test for merging attribute with an EEnum type (both multi and single value). Adds test merging conflicting diff onattribute with and EEnum type (both single and multi). Change-Id: Ic522012a6e3d7fa6252b6adec186fc223d816ecb
2014-12-16[454579] Fix Nullpointer when element is moved out of FeatureMapStefan Dirix6-0/+172
The FeatureMapChangeMerger is intended to handle manipulations of FeatureMaps. When used to work on the Non-Feature-Map side of an operation a NullPointerException is thrown. This patch changes the AbstractMerger so that equivalent ReferenceChanges will be preferred in this scenario. The AbstractMerger is also modified to first search for the master equivalence and only after that to check for equivalences with conflicts. This avoids an issue where multiple equivalences with conflicts exist and the less fitting one is chosen. Includes 2-way and 3-way testcases. Bug: 454579 Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Change-Id: I8a264b09a7a8011121c341673638eda052afb422
2014-12-04[442897] Pseudo conflicts under Real Add conflictsAxel Richard20-0/+731
Pseudo conflicts under Real Add conflicts must be detected as Real conflicts, because pseudo conflicts are equivalent. But under a real add conflict, we must have the possibility to merge a diff separately. Bug: 442897 Change-Id: Id72634cdefa65698e82fc0aab9f227bb88915e24 Signed-off-by: Axel Richard <axel.richard@obeo.fr>
2014-12-03[453749] Fix NullPointer when handling Non-Containment FeatureMapsStefan Dirix4-0/+60
When handling FeatureMaps whose entries consists of references instead of containments, NullPointer exceptions occur when removing those entries. This patch fixes the NullPointer and edits the FeatureMapChangeMerger to only modify matches if the removed FeatureMapEntry was a containment. Includes Testcase. Bug: 453749 Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Change-Id: I540f983942fcc4c1633a42003b9babb6cb78e580
2014-11-18[441172] Extend findMasterEquivalence to not only check eOppositesStefan Dirix4-2/+97
Currently the findMasterEquivalence method only considers equivalences whose reference is the eOpposite of the given diff. But sometimes the equivalence's reference is the same as the one given by the diff. The findMasterEquivalence method is extended to handle these cases too. Includes testcases for this issue. Bug: 441172 Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Also-by: Laurent Goubet <laurent.goubet@obeo.fr> Change-Id: Ic3678939c0798c9993c41d329f6c0d4e4d098c27
2014-11-17[450949] Avoid shortcuts in DefaultDiffEngine for certain FeatureMapsStefan Dirix5-3/+147
Changes in FeatureMaps should be merged via FeatureMapChanges in the FeatureMapChangeMerger. In cases of added / removed elements the DefaultDiffEngine prevents the calculation of required FeatureMapChanges since they only affect attributes of those elements. This leads to ordering problems since the ReferenceChangeMerger can not handle FeatureMaps properly. This fix removes the calculation prevention for these cases. Includes testcases for this issue. Bug: 450949 Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Change-Id: Ie21a54c2e08b27bcc421f1c28d42e542407b990d
2014-11-04[446252] Issue with feature ordering when merging FeatureMapsAlexandra Buzila6-4/+63
In the case of equivalent ReferenceChange and FeatureMapChanges, the FeatureMapChanges will take precedence when merging. This ensures that the order of references inside the feature map is correctly maintained. The commit includes a new test case for the issue and updates the existing test cases reaching the affected code. Bug: 446252 Change-Id: I1bd13aadbd8e43c055a424329a5e70c8e47baca4 Signed-off-by: Alexandra Buzila <alexandra.buzila@gmail.com>
2014-10-29[448464] Source list incorrectly determined when undoing changesAlexandra Buzila1-3/+6
When computing the insertion index during a three-way merge of a change that affects multi-valued features, the source list of a diff was incorrectly determined in DiffUtil#getSourceList(Comparison comparison, Diff diff, boolean rightToLeft) if the current merging undoes a change. With the current fix, the source list is obtained from the _target container_ retreived from the _match in the origin_, as opposed to the list obtained from the _match in the origin_. The commit also updates the tests that are reaching the now modified code. Bug: 448464 Change-Id: I3c53b9ff533b1466d5fddce5f91f5b6de38d9fe8 Signed-off-by: Alexandra Buzila <alexandra.buzila@gmail.com>
2014-10-27[446947] Adds support for three-way merging multi-line String attributesPhilip Langer5-1/+1127
Changes applied to String attributes, which might for instance contain multiple lines of code in a model (e.g., OpaqueBehaviors in UML), will now be checked whether concurrent changes in the context of a three-way diff are mergeable using a three-way line-based merge algorithm. If yes, no conflict will be raised and they will be merged line by line. Therefore, this commit introduces a copy of the diff_match_patch class R106 and a ThreeWayTextDiff utility, which extends the capabilities of diff_match_patch to support three-way diffing and merging of text (as opposed to two-way diffing only). Bug: 446947 CQ: 8824 Change-Id: Ifc7a3144461f7d47750b90a8098d565279ee826d Signed-off-by: Philip Langer <planger@eclipsesource.com>
2014-10-20[441172] Fix merge order of equivalent diffs for one-to-one oppositesStefan Dirix6-2/+223
When determining which one of the equivalent differences of one-to-one eOpposites will be merged above the others, differences which result in setting a feature value instead of unsetting a feature will be preferred. Includes testcases for both merge directions. Bug: 441172 Signed-off-by: Stefan Dirix <st.dirix@gmail.com> Change-Id: I2e98f44e5e440c82ec95135db622225c65dc07b3
2014-10-14[446739] Fixes obtaining the target feature in three-way merge of a movePhilip Langer6-1/+211
We now make sure that the target feature is correctly determined. This prevents a NullPointerException thrown during a three-way merge of a move, in which the target containment feature is not available in the type of the original containment feature. Bug: 446739 Signed-off-by: Philip Langer <planger@eclipsesource.com> Change-Id: I98a7f37bb5e43f10ddaf4a042893ed4773bf25b9
2014-10-10Adds year of contribution to copyright headerPhilip Langer2-2/+2
Change-Id: I5dabe48f506ea413ad7db71ea28d144bcfda957b Signed-off-by: Philip Langer <planger@eclipsesource.com>
2014-10-08Optimize dice coefficient storing bigrams within intsLaurent Goubet1-0/+21
Bigrams are a combination of two char objects, which are stored on 16 bits. We can take advantage of that and store them within ints instead, allowing us to use simple arithemtics instead of String comparison to compare the bigrams together, making the whole dice coefficient computation faster in turn. Change-Id: I532f02cfc1505b5722f3c757c1e933461d1df383
2014-10-08Consider potential duplicates in String similarityLaurent Goubet1-4/+42
We need to ensure that "aaa" is never considered to be equal to "aaaa". The previous unit tests were failing to notice the logic error since we were only comparing "aa" and "aaaa"... whereas "aa" is less than or equal to two characters long, falling into a special case within DiffUtils. Bug: 444712 Change-Id: I0e81e58eadc288f5a79daac75e245f33ca655119
2014-09-25[443031] Fix NPE on FeatureFilter.referenceIsSetAxel Richard5-1/+173
Fix NPE on FeatureFilter.referenceIsSet Add tests Bug: 443031 Change-Id: Id2ecebcff6c174341199451d472aad4c06101239 Signed-off-by: Axel Richard <axel.richard@obeo.fr>
2014-09-25[443968] Fix NPE in ComparisonUtils.getSubDiffsAxel Richard1-0/+25
Fix NPE in ComparisonUtils.getSubDiffs Add test Bug: 443968 Change-Id: I0fa1d0105b12cebaaee534ea087b912bf3b7143f Signed-off-by: Axel Richard <axel.richard@obeo.fr>
2014-09-25[443504] Fix computation of ignored elements when finding insertion idxPhilip Langer4-0/+71
When finding the insertion index of a multi-valued feature, we now make sure that values of the target list are only ignored in the computation of the LCS, when there is another unresolved diff element that not only concerns the same feature and same value but also the same target container. Therefore, we extended and refactored the UnresolvedDiffMatching predicate, which is used for filtering out values to be ignored, and provide it with the additional information needed for determining the target container (i.e., direction of merging). Bug: 443504 Change-Id: I8b9978c1e21593db6fd092e1e87b032ea0f5f425 Signed-off-by: Philip Langer <planger@eclipsesource.com>
2014-09-19[444351] Fix bug in EqualityHelper.matchingArraysAxel Richard2-1/+107
EqualityHelper.matchingArrays now returns false for arrays of different lengths Add very basic tests for EqualityHelper.matchingValues Bug: 444351 Change-Id: I569e3f0bae796fbb8d2cc35196f550480ce25516 Signed-off-by: Axel Richard <axel.richard@obeo.fr>
2014-08-24[442439] Fixes DiffUtil.getSourceList for moved and reordered elementsPhilip Langer4-1/+54
For obtaining the source list in case of a move, we now use DiffUtil.getTargetList and then get the matching container on the source side instead of getting the left or right parent match of the diff element, which might be the wrong container if the elements have been moved into a different container. Bug: 442439 Change-Id: I64cb1f8d8457cbc9c6739fdf3c7c28a1ef0e8a7f Signed-off-by: Philip Langer <planger@eclipsesource.com>
2014-08-22Fix merge-related UI feedback of the Structure viewerLaurent Goubet1-70/+134
This introduces API for the mergers to describe what they consider to be implications of a given merge operation, whether it be diffs that need to be merged along the selected one or diffs that need to be rejected because of the seleced one. IMerger2 allows clients to describe their own algorithm, AbstractMerger implementing the default navigation. Change-Id: I4ac1f0590b19ad81934c0244e1d962feae88a2c9 Signed-off-by: Laurent Goubet <laurent.goubet@obeo.fr>
2014-08-20[441258] Prevents IllegalArgumentException on merging movesPhilip Langer4-0/+62
When the target reference of a move is multi-valued, the ReferenceChangeMerger invokes DiffUtil.findInsertionIndex(Comparison, Diff, boolean), which in turn throws an IllegalArgumentException, if the feature to which the ReferenceChange refers is single-valued. This, however, can happen when moving an element form a single-valued reference to a multi-valued reference and doing a right to left merge. To prevent this IllegalArgumentException, we make sure that only the target reference is checked for being multi-valued, irrespectively of whether the difference refers to the single-valued or multi-valued containment reference involved in the move. Therefore, we had to refactor out methods for getting the target feature and container. Signed-off-by: Philip Langer <planger@eclipsesource.com> Bug: 441258 Change-Id: I3e7b6609145023a453d890259809d3d332af7f38
2014-08-20Adds test case exposing unsuccessful merge reported in bug 441172Philip Langer4-1/+76
Bug: 441172 Change-Id: Id68ea8671543d12070108ece3ffbde1401c9d1bf Signed-off-by: Philip Langer <planger@eclipsesource.com>
2014-08-13Do not use assertSame for int comparison (2)Mikaël Barbero3-89/+87
Change-Id: Iae5a6278c36b3d9a382695012546e208403e2ec0
2014-08-13Do not use assertSame for int comparisonMikaël Barbero19-1067/+1064
Change-Id: Ia66b0f5d243f33e5aca11f807f4c13359e276a09
2014-08-05[413520] Fixes IndexOutOfBoundsException on merging opposite referencesPhilip Langer4-17/+114
The IndexOutOfBoundsExceptions occurred when a one-to-many reference has been changed, whereas the original object on the single-valued side of the one-to-many reference has been deleted. During the check for the ordering of the target values affected by equivalent changes (in this case, changes of opposite references) in ReferenceChangeMerger.internalCheckOrdering(ReferenceChange, boolean), the source and target container and, in the next step, their values at the feature constituting the multi-valued side of a one-to-many reference are obtained and their LCS is computed to finally move the respective value. However, when the original object on the source side has been deleted, the source container is null, and the values at the respective feature are empty. DiffUtil.findInsertionIndex will still return 0, so that EList.move(index, value) is called, whereas value is not available in the list, which ultimately causes the exception. This commit prevents the call of ReferenceChangeMerger.internalCheckOrdering(ReferenceChange, boolean) for any difference that is not an addition to a multi-valued feature in the current merge (thus, not a move or a delete), since only for such differences a check of the resulting order should be necessary. Signed-off-by: Philip Langer <planger@eclipsesource.com> Bug: 413520 Change-Id: I363b5c12538f847cf0d0a359000969a2e09f54f4
2014-07-31[440679] Avoids NPE when performing a movePhilip Langer7-1/+196
We now make sure that the correct feature (i.e., the target feature of the target container) is used when obtaining the target value list (current list of values in the target container's feature) for finding the insertion index. Signed-off-by: Philip Langer <planger@eclipsesource.com> Bug: 440679 Change-Id: I02798dc702c3a17c49ae63d80cf6a099858b7d89
2014-07-18Adds Item provider preference page.Arthur Daussy1-0/+12
Creates a preference page to enable/disable adapter factories registered into EMF Compare. Change-Id: Ibaa61852769cc3a1710cc2bbd00bba30a7b1b391 Signed-off-by: Arthur Daussy <arthur.daussy@obeo.fr>
2014-07-17Filters EMF compare adapter factories using preferences.Arthur Daussy1-3/+12
Instantiates a new RankedAdapterFactoryDescriptorRegistryImpl for each comparison in order to filter disabled adapter factories. Change-Id: If60bc137c0c2221fd3df062581681c50e0c8038d Signed-off-by: Arthur Daussy <arthur.daussy@obeo.fr>
2014-07-07FeatureMaps: FeatureMapChanges testsAxel Richard75-2/+9708
Add feature map element in nodes.ecore Add core tests Change-Id: I61becd6b8f28cb8f494951493e8367759eaa2e4b
2014-07-07FeatureMaps: Handle FeatureMapChange differencesAxel Richard1-8/+17
FMC.add: an entry has been added on a side. FMC.delete: an entry has been deleted on a side. FMC.change: a key changed for the same value FMC.move: a value moved from a map to another Handle 2-way and 3-way, in detection, display and merge. Change-Id: I91ec59d8a779b46f1bc6633be21448669d98e044
2014-06-04Fix regression: wrapped command stack events should be forwared tooMikaël Barbero1-7/+11
It also dispose properly EMFCompareEditingDomain where it is created. Change-Id: If9ec547cde7c125832c45cb24b88d7d2c2ff5313
2014-06-02Add transactional compare command stackMikaël Barbero5-16/+561
Also improves robustness and event triggerring about modifications. Change-Id: I600cfa9f4910d26a85a8c60bcbc0b956a2c1a842
2014-05-28[434822] Conflict between move and deleteArthur Daussy1-1/+23
Fix merge and display in case of a conflict between a move and a delete. Tests the merge data after accepting and rejecting differences. Bug: 434822 Change-Id: I7c61a077a984fc8039fc250c88bf2b1bafa9e7ce Signed-off-by: Arthur Daussy <arthur.daussy@obeo.fr> Also-by: Axel Richard <axel.richard@obeo.fr>
2014-05-23[435053] Add Pseudo conflicts tests.Axel Richard15-1/+778
In case of a pseudo conflict, no merge action is performed, even in ACCEPT/REJECT mode. Add tests for pseudo conflicts. Bug: 435053 Change-Id: I450c6676633502bb001829c889336023ee0d1cc1
2014-05-21[435376] Conflicted subdiffs shouldn't be merged when CascadingFilter isAxel Richard1-3/+3
active Bug: 435376 Change-Id: I54681d8fd72643a6454f1d4d810e4d35ef006d30
2014-04-02New tests: Test MatchEngineFactoryRegistryWrapperArthur Daussy6-1/+722
Add unit tests for MatchEngineFactoryRegistryWrapper. Change-Id: I8eff59e8acd34c69a036c18626b4969f9944c625 Signed-off-by: Arthur Daussy <arthur.daussy@obeo.fr>
2014-04-02New tests: Test ItemRegistryArthur Daussy3-1/+202
Add unit tests for ItemRegistry. Change-Id: I50fd60e42d9f8424bf0d68cb742d3a4782dad0c7 Signed-off-by: Arthur Daussy <arthur.daussy@obeo.fr>
2014-03-28[406516] Manage Parameterized Types in ComparisonAxel Richard6-2/+350
Bug: 406516 Change-Id: Ibccd5f9a6881548c08db07466128e88be4e9889e
2014-03-28[418472] Cannot merge a move from nestedClassifier to packagedElementAxel Richard4-1/+117
In case of containment references, the target reference of a move diff can be different from the source reference. This case wasn't managed by compare. Bug: 418472 Change-Id: Ibe82d0b74992174567381a604d772867b51327db
2014-03-25[406439] EMF Compare does not support list with null valuesAxel Richard1-0/+24
Nulls are a valid value of the attribute lists. Change ImmutableList.copyOf() for Collections.unmodifiableList(). Add new test case in DiffUtilTest to test null values. Bug: 406439 Change-Id: Ic75f8d87f00d896529a18d807a9451569c53a100
2014-03-13normalize EOLs in the core (first pass)Laurent Goubet71-18995/+18995
Change-Id: Id5b351cc3c89777401f672c85abb46560ee461b3

Back to the top