Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Camille
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
Camille
Commits
cc2de809
Commit
cc2de809
authored
Jun 16, 2015
by
Sebastian Krings
Browse files
Options
Downloads
Patches
Plain Diff
drop some problematic emf diffs, see comment
parent
11dbb6c4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.eventb.texttools/src/org/eventb/texttools/PersistenceHelper.java
+20
-0
20 additions, 0 deletions
...texttools/src/org/eventb/texttools/PersistenceHelper.java
with
20 additions
and
0 deletions
org.eventb.texttools/src/org/eventb/texttools/PersistenceHelper.java
+
20
−
0
View file @
cc2de809
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
package
org.eventb.texttools
;
package
org.eventb.texttools
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
...
@@ -21,6 +22,7 @@ import org.eclipse.emf.common.util.EMap;
...
@@ -21,6 +22,7 @@ import org.eclipse.emf.common.util.EMap;
import
org.eclipse.emf.common.util.URI
;
import
org.eclipse.emf.common.util.URI
;
import
org.eclipse.emf.compare.Comparison
;
import
org.eclipse.emf.compare.Comparison
;
import
org.eclipse.emf.compare.Diff
;
import
org.eclipse.emf.compare.Diff
;
import
org.eclipse.emf.compare.DifferenceKind
;
import
org.eclipse.emf.compare.EMFCompare
;
import
org.eclipse.emf.compare.EMFCompare
;
import
org.eclipse.emf.compare.diff.DefaultDiffEngine
;
import
org.eclipse.emf.compare.diff.DefaultDiffEngine
;
import
org.eclipse.emf.compare.diff.IDiffEngine
;
import
org.eclipse.emf.compare.diff.IDiffEngine
;
...
@@ -209,6 +211,8 @@ public class PersistenceHelper {
...
@@ -209,6 +211,8 @@ public class PersistenceHelper {
registry
.
add
(
evbMerger
);
registry
.
add
(
evbMerger
);
BatchMerger
bm
=
new
BatchMerger
(
registry
);
BatchMerger
bm
=
new
BatchMerger
(
registry
);
differences
=
filter
(
differences
);
bm
.
copyAllRightToLeft
(
differences
,
null
);
bm
.
copyAllRightToLeft
(
differences
,
null
);
long
time2
=
System
.
currentTimeMillis
();
long
time2
=
System
.
currentTimeMillis
();
...
@@ -218,6 +222,22 @@ public class PersistenceHelper {
...
@@ -218,6 +222,22 @@ public class PersistenceHelper {
}
}
}
}
// for some reasons, there are still problematic diffs:
// usually, they can be identified as follows:
// 1. right = null, i.e. Camille does not hold this element
// 2. ADD, i.e. the "nothing" coming from Camille is added to the EMF model
// => we drop the diff before we screw up the database
// Obvoiusly it would be better not to generate the diff at all....
private
static
List
<
Diff
>
filter
(
List
<
Diff
>
differences
)
{
List
<
Diff
>
newList
=
new
ArrayList
<
Diff
>();
for
(
Diff
d
:
differences
)
{
if
(!(
d
.
getKind
()
==
DifferenceKind
.
ADD
&&
d
.
getMatch
().
getRight
()
==
null
))
{
newList
.
add
(
d
);
}
}
return
newList
;
}
public
static
void
mergeRootElement
(
final
Resource
resource
,
public
static
void
mergeRootElement
(
final
Resource
resource
,
final
EventBNamedCommentedComponentElement
newVersion
,
final
EventBNamedCommentedComponentElement
newVersion
,
final
IProgressMonitor
monitor
)
{
final
IProgressMonitor
monitor
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment