Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » EMF Compare merge conflicts problem
EMF Compare merge conflicts problem [message #1753514] Tue, 07 February 2017 11:13 Go to next message
Monica Coman is currently offline Monica ComanFriend
Messages: 13
Registered: January 2017
Junior Member
Hi!

I am using EMF Compare to handle model merging in my own EMF-based application and I have encountered a problem in the UI when merging conflicts.

In the picture below you can see the conflicts I'm looking at:
index.php/fa/28366/0/

What basically happened, in this case, is the following:
1. On the remote, a Component has been deleted;
2. Locally, a Variable has been added to the same Component which was deleted remotely. (in our ecore model, Variables are contained in a Component)

This, of course, resulted in a conflict.

What I don't understand is how are the relations between these 3 differences shown as conflicts created?
In the background, the difference selected in the picture above only has the ResourceAttachmentChange in the implies list but its acceptance also seems to influence the addition difference. Why is that and where could that relation come from?

Moreover, even though the UI shows that accepting the currently selected difference will accept the 2 others as well, what happens in the background is that both the Addition and the ResourceAttachmentChange are rejected.

Last but not least, even after accepting the selected difference, the UI shows the reject 'x' sign on all differences, see the picture below:
index.php/fa/28365/0/

So it seems like the UI and input are somehow not in sync?

Thanks,
Monica
Re: EMF Compare merge conflicts problem [message #1753621 is a reply to message #1753514] Wed, 08 February 2017 08:54 Go to previous messageGo to next message
Philip Langer is currently offline Philip LangerFriend
Messages: 83
Registered: March 2015
Location: Vienna, Austria
Member

Hi Monica,

You have three differences

  • Left: variables add
  • Right: components delete, "uncontrol" of component

The conflict is between left variables add and right components delete

Quote:
What I don't understand is how are the relations between these 3 differences shown as conflicts created?
In the background, the difference selected in the picture above only has the ResourceAttachmentChange in the implies list but its acceptance also seems to influence the addition difference. Why is that and where could that relation come from?


There is a relationship between right components delete and right "uncontrol" of component, because the deletion of the component entails the "uncontrol", if the component is a root element in its resource. I don't know by heart, but I guess, the resource attachment change should show up in the requiredBy list of the reference change. As a background info, the requirement-relationships are defined by the org.eclipse.emf.compare.req.DefaultReqEngine.

If you now accept the components delete, you'll automatically accept all its requirements and reject all its conflicting diffs on the opposite side (which is the addition of the variable in this case).

Quote:
Moreover, even though the UI shows that accepting the currently selected difference will accept the 2 others as well, what happens in the background is that both the Addition and the ResourceAttachmentChange are rejected.


Yeah, I'm pretty sure there is a bug that the colors of the consequences are wrong. It'd be great if you could post your (or a simplified) model comparison scenario (the three models), to reproduce the wrong colors of the consequences. Conflicting diffs should show up with a red background color and not a green one.

Quote:
Last but not least, even after accepting the selected difference, the UI shows the reject 'x' sign on all differences, see the picture below:


I'm afraid, this is a bug too. But at least it is known and there is already a patch on its way (see https://git.eclipse.org/r/#/c/90181/).

Hope that helps,

Philip

--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/


--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: EMF Compare merge conflicts problem [message #1753741 is a reply to message #1753621] Thu, 09 February 2017 14:29 Go to previous messageGo to next message
Monica Coman is currently offline Monica ComanFriend
Messages: 13
Registered: January 2017
Junior Member
Hi, Philip!

Thanks a lot for your answer Smile

Quote:
Yeah, I'm pretty sure there is a bug that the colors of the consequences are wrong. It'd be great if you could post your (or a simplified) model comparison scenario (the three models), to reproduce the wrong colors of the consequences. Conflicting diffs should show up with a red background color and not a green one.

Unfortunately, I cannot really provide the models to reproduce the issue since they wouldn't really work outside of our application. So, unless you can reproduce it with the info I provided above:
a. Left - add containment reference on an element;
b. Right - delete that element which gives 2 changes: delete containment reference on the element's parent (eContainer) and "uncontrol" of the element;
Then we'll have to wait until someone who can provide the models finds this issue as well Sad

Quote:
I'm afraid, this is a bug too. But at least it is known and there is already a patch on its way (see https://git.eclipse.org/r/#/c/90181/)

This sounds like good news! Do you have any timeline for when a patch with the fix will be released? I couldn't really figure out the status of the issue from the link you sent.

Quote:
There is a relationship between right components delete and right "uncontrol" of component, because the deletion of the component entails the "uncontrol", if the component is a root element in its resource. I don't know by heart, but I guess, the resource attachment change should show up in the requiredBy list of the reference change. As a background info, the requirement-relationships are defined by the org.eclipse.emf.compare.req.DefaultReqEngine.


It is true that the component is a root element in its resource. However, the resource attachment change does not appear in the requiredBy list of the reference change. It appears in none of its lists actually!

The only connection I could find between the resource attachment change and the reference change was the requires lists which contained the same 2 reference changes.

A small clarification, just to be sure we're on the same page:
- the components delete reference on the right is in one file (the file which contains the component's parent/eContainer) and the component itself is in another file hence the "uncontrol" change when deleting the component/the file.

An interesting observation is that if I consider the opposite case:
a. Left - delete that element which gives 2 changes: delete containment reference on the element's parent (eContainer) and "uncontrol" of the element;
b. Right - add containment reference on an element;
Everything works exactly as expected.

I tried to explain all the tests I made and the behavior I experienced in the table below.
-the numbers show the order of the actions performed by the user
-auto means a difference was accepted/rejected due to a user action
index.php/fa/28382/0/
  • Attachment: table.png
    (Size: 25.70KB, Downloaded 261 times)
Re: EMF Compare merge conflicts problem [message #1753940 is a reply to message #1753741] Mon, 13 February 2017 08:33 Go to previous messageGo to next message
Philip Langer is currently offline Philip LangerFriend
Messages: 83
Registered: March 2015
Location: Vienna, Austria
Member

Hi Monica,

Quote:
Unfortunately, I cannot really provide the models to reproduce the issue since they wouldn't really work outside of our application. So, unless you can reproduce it with the info I provided above:
a. Left - add containment reference on an element;
b. Right - delete that element which gives 2 changes: delete containment reference on the element's parent (eContainer) and "uncontrol" of the element;
Then we'll have to wait until someone who can provide the models finds this issue as well


That's a pity. It'd be very helpful if you could create models to reproduce the problem (e.g. Ecore models).

Quote:
This sounds like good news! Do you have any timeline for when a patch with the fix will be released? I couldn't really figure out the status of the issue from the link you sent.


I don't think there will be an intermediate release. So the next release will probably be together with Oxygen (June 2017).

Quote:
The only connection I could find between the resource attachment change and the reference change was the requires lists which contained the same 2 reference changes.


Ok, requiring the same change does not mean that they will be always be merged together. I now re-read your first post, however, and there you write that the component delete _implies_ the resource attachment change, right? This causes the resource attachment change to be merged whenever the component delete is merged. I suggest to debug into this method:
org.eclipse.emf.compare.merge.AbstractMerger.getImpliedMerges(Diff, boolean)

There you'll see how the implied diffs are handled in the successful case and what is different in the failing case. It'd be great, if you could report your findings back and report a bug with example Ecore models, if necessary.

Thanks and best wishes,

Philip

--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/


--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: EMF Compare merge conflicts problem [message #1764772 is a reply to message #1753940] Fri, 02 June 2017 08:33 Go to previous messageGo to next message
Monica Coman is currently offline Monica ComanFriend
Messages: 13
Registered: January 2017
Junior Member
Hi, Philip!

I know it's been a while with no reply but we've put the development of this feature on pause for a while and now I'm starting to work on it again.

I was re-reading your post and was looking for this method that you mentioned but I realized it's not there. Was it implemented in a recent version of emf compare or am I not looking in the right place? The version I am using is org.eclipse.emf.compare_3.3.0.201602111426.

Thanks,
Monica
Re: EMF Compare merge conflicts problem [message #1764984 is a reply to message #1764772] Mon, 05 June 2017 13:19 Go to previous messageGo to next message
Philip Langer is currently offline Philip LangerFriend
Messages: 83
Registered: March 2015
Location: Vienna, Austria
Member

Hi Monica,

yes, the method has been introduced in 3.5. You can always start debugging in
org.eclipse.emf.compare.merge.AbstractMerger.copyLeftToRight(Diff, Monitor)
and
org.eclipse.emf.compare.merge.AbstractMerger.copyRightToLeft(Diff, Monitor)
to see which diffs get pulled in during the merge and why.

Since a new version of EMF Compare will be released end of June, it may pay off to work with the current master and switch to the released version then, as there has been many changes in the diff dependency management during the merge.

Best wishes,

Philip

--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/


--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: EMF Compare merge conflicts problem [message #1765072 is a reply to message #1764984] Tue, 06 June 2017 11:43 Go to previous messageGo to next message
Monica Coman is currently offline Monica ComanFriend
Messages: 13
Registered: January 2017
Junior Member
Thank you for the reply, Philip!

I was also looking into the 2 methods you mentioned, let's see if I can figure something out but we'll definitely keep an eye on the next release you have coming up.

BR,
Monica
Re: EMF Compare merge conflicts problem [message #1767832 is a reply to message #1765072] Tue, 11 July 2017 12:51 Go to previous messageGo to next message
Monica Coman is currently offline Monica ComanFriend
Messages: 13
Registered: January 2017
Junior Member
Hi, Philip!

I updated to the latest 3.3.1 RC4 version and it has indeed improved a lot of the problems I've experienced regarding merge conflicts. I have however experienced a different problem (https://www.eclipse.org/forums/index.php/t/1087147/) which I somehow hoped it would be miraculously fixed in the released version, do you have any news about when is that coming? You mentioned the end of June earlier, has the date been postponed?

Thank you for your time,

Monica
Re: EMF Compare merge conflicts problem [message #1768149 is a reply to message #1767832] Fri, 14 July 2017 07:36 Go to previous messageGo to next message
Philip Langer is currently offline Philip LangerFriend
Messages: 83
Registered: March 2015
Location: Vienna, Austria
Member

Hi Monica,

I'm not sure exactly, when EMF Compare 3.3.1 will be released. Laurent can probably give you more details about the release plan.

In the meantime, you can try to use this update site to get the latest EMF Compare:
http://download.eclipse.org/modeling/emf/compare/updates/logical/emf.compare/nightly/latest

In contains the nightly build plus some additional performance and bug fixes.

Hope this helps!

Best wishes,

Philip

--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/


--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: EMF Compare merge conflicts problem [message #1768376 is a reply to message #1768149] Tue, 18 July 2017 07:32 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1855
Registered: July 2009
Senior Member
Hi,

3.3.1RC4 is the actual release of 3.3.1, but I've yet to properly rename the release bits. The problem Monica describes in that other message is something I cannot debug though, we would need test samples to reproduce and hopefully fix.

Regards,

Laurent Goubet
Obeo
Previous Topic:EMFCompare programatically for comparing Local History of a model
Next Topic:EMF Compare Performance
Goto Forum:
  


Current Time: Sat Apr 21 21:37:55 GMT 2018

Powered by FUDForum. Page generated in 0.02268 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software