Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Compare] Problem with three way merge
[EMF Compare] Problem with three way merge [message #500539] Thu, 26 November 2009 14:40 Go to next message
Jose Hernandez is currently offline Jose HernandezFriend
Messages: 32
Registered: July 2009
Member
Hi,

I'm trying to merge the contents of two instances of the same model using a
three (3) way merge after making a small change to each of the instaces but,
I am finding that the merged model contains only one set of changes, e.g.
the changes between ancestorEmfModel and remoteEmfModel. EMF compare is
removing the changes made in localEmfModel. This is the code that I'm
using:

MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
remoteEmfModel, ancestorEmfModel,
Collections.<String, Object> singletonMap(MatchOptions.OPTION_IGNORE_ID,
true));
DiffModel diffModel = DiffService.doDiff(matchModel, false);
MergeService.merge(new ArrayList<DiffElement>(diffModel.getOwnedElements()),
true);

Is there any way of ensuring that EMF compare does not remove the changes
that took place between ancestorEmfModel and localEmfModel so that after a
merge I end up with both sets of changes?

Regards,
Jose
Re: [EMF Compare] Problem with three way merge [message #500546 is a reply to message #500539] Thu, 26 November 2009 15:45 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050902020100060901020206
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jose,

Depending on the changes you made, it might be normal that EMF Compare
ignores the change to the local model. For example if you made the exact
same change between the remote and ancestor models, then there is in
fact no difference to be detected, let alone be merged.

Could you describe the exact changes you made in each models?

Laurent Goubet
Obeo

Jose Hernandez wrote:
> Hi,
>
> I'm trying to merge the contents of two instances of the same model using a
> three (3) way merge after making a small change to each of the instaces but,
> I am finding that the merged model contains only one set of changes, e.g.
> the changes between ancestorEmfModel and remoteEmfModel. EMF compare is
> removing the changes made in localEmfModel. This is the code that I'm
> using:
>
> MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
> remoteEmfModel, ancestorEmfModel,
> Collections.<String, Object> singletonMap(MatchOptions.OPTION_IGNORE_ID,
> true));
> DiffModel diffModel = DiffService.doDiff(matchModel, false);
> MergeService.merge(new ArrayList<DiffElement>(diffModel.getOwnedElements()),
> true);
>
> Is there any way of ensuring that EMF compare does not remove the changes
> that took place between ancestorEmfModel and localEmfModel so that after a
> merge I end up with both sets of changes?
>
> Regards,
> Jose
>
>


--------------050902020100060901020206
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------050902020100060901020206--
Re: [EMF Compare] Problem with three way merge [message #500554 is a reply to message #500546] Thu, 26 November 2009 16:31 Go to previous messageGo to next message
Jose Hernandez is currently offline Jose HernandezFriend
Messages: 32
Registered: July 2009
Member
Hi Laurent,

I added an element to the repository model and removed and element from the
local model. More specifically, the model has a map and a list, I added an
element to the map in the repository model and removed an element from the
list in the local model and then attempted to combine the two. I seem to be
getting a conflicting change in the map but this doesn't make sense since
the the map has only had an element added to it in one of the model
instances and not the other.

If I merge right to left I get this diff model:

<?xml version="1.0" encoding="Cp1252"?>
<diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
<ownedElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
<rightParent
href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
<leftElement
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
</subDiffElements>
<rightParent
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
</subDiffElements>
<rightParent
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0 "/>
</subDiffElements>
<subDiffElements xsi:type="diff:ConflictingDiffElement">
<subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
remote="true">
<rightParent
href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
<leftElement
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
</subDiffElements>
<leftParent
href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
<rightParent
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
</subDiffElements>
<rightParent
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
</subDiffElements>
</ownedElements>
<leftRoots
href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
<rightRoots
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
<ancestorRoots
href=" 423a8e75-1832-43b7-8fd8-b01179fdf2dd.entitlementcalculation# / "/>
</diff:DiffModel>

and if I merge left to right I get this:

<?xml version="1.0" encoding="Cp1252"?>
<diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
<ownedElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:ConflictingDiffElement">
<subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
remote="true">
<rightParent
href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
<leftElement
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
</subDiffElements>
<leftParent
href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
<rightParent
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
</subDiffElements>
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
<rightParent
href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
<leftElement
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
</subDiffElements>
<rightParent
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
</subDiffElements>
<rightParent
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0 "/>
</subDiffElements>
<rightParent
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
</subDiffElements>
</ownedElements>
<leftRoots
href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
<rightRoots
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
<ancestorRoots
href=" 1843d754-d1c6-4175-97bd-b60b58b8d362.entitlementcalculation# / "/>
</diff:DiffModel>

Regards,
Jose

"Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
news:hem7r8$3j9$1@build.eclipse.org...
> Hi Jose,
>
> Depending on the changes you made, it might be normal that EMF Compare
> ignores the change to the local model. For example if you made the exact
> same change between the remote and ancestor models, then there is in
> fact no difference to be detected, let alone be merged.
>
> Could you describe the exact changes you made in each models?
>
> Laurent Goubet
> Obeo
>
> Jose Hernandez wrote:
>> Hi,
>>
>> I'm trying to merge the contents of two instances of the same model using
>> a
>> three (3) way merge after making a small change to each of the instaces
>> but,
>> I am finding that the merged model contains only one set of changes, e.g.
>> the changes between ancestorEmfModel and remoteEmfModel. EMF compare is
>> removing the changes made in localEmfModel. This is the code that I'm
>> using:
>>
>> MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
>> remoteEmfModel, ancestorEmfModel,
>> Collections.<String, Object>
>> singletonMap(MatchOptions.OPTION_IGNORE_ID,
>> true));
>> DiffModel diffModel = DiffService.doDiff(matchModel, false);
>> MergeService.merge(new
>> ArrayList<DiffElement>(diffModel.getOwnedElements()),
>> true);
>>
>> Is there any way of ensuring that EMF compare does not remove the changes
>> that took place between ancestorEmfModel and localEmfModel so that after
>> a
>> merge I end up with both sets of changes?
>>
>> Regards,
>> Jose
>>
>>
>
>
Re: [EMF Compare] Problem with three way merge [message #500641 is a reply to message #500554] Fri, 27 November 2009 09:28 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080109020103090907090705
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Jose,

You changed the same reference from both local and distant model
differently, thus giving you a conflicting change. That doesn't really
surprise me. What surprises me more is that merging doesn't seem to have
changed any of the models in any way :'(.

Could you provide us with the models you use, or are they confidential?
Anyway, please raise a bug describing the issue on the eclipse bugzilla.

Laurent Goubet
Obeo

Jose Hernandez wrote:
> Hi Laurent,
>
> I added an element to the repository model and removed and element from the
> local model. More specifically, the model has a map and a list, I added an
> element to the map in the repository model and removed an element from the
> list in the local model and then attempted to combine the two. I seem to be
> getting a conflicting change in the map but this doesn't make sense since
> the the map has only had an element added to it in one of the model
> instances and not the other.
>
> If I merge right to left I get this diff model:
>
> <?xml version="1.0" encoding="Cp1252"?>
> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
> <ownedElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
> <rightParent
> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
> <leftElement
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
> </subDiffElements>
> <rightParent
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
> </subDiffElements>
> <rightParent
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0 "/>
> </subDiffElements>
> <subDiffElements xsi:type="diff:ConflictingDiffElement">
> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
> remote="true">
> <rightParent
> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
> <leftElement
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
> </subDiffElements>
> <leftParent
> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
> <rightParent
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
> </subDiffElements>
> <rightParent
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
> </subDiffElements>
> </ownedElements>
> <leftRoots
> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
> <rightRoots
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
> <ancestorRoots
> href=" 423a8e75-1832-43b7-8fd8-b01179fdf2dd.entitlementcalculation# / "/>
> </diff:DiffModel>
>
> and if I merge left to right I get this:
>
> <?xml version="1.0" encoding="Cp1252"?>
> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
> <ownedElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:ConflictingDiffElement">
> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
> remote="true">
> <rightParent
> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
> <leftElement
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
> </subDiffElements>
> <leftParent
> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
> <rightParent
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
> </subDiffElements>
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
> <rightParent
> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
> <leftElement
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
> </subDiffElements>
> <rightParent
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
> </subDiffElements>
> <rightParent
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0 "/>
> </subDiffElements>
> <rightParent
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
> </subDiffElements>
> </ownedElements>
> <leftRoots
> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
> <rightRoots
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
> <ancestorRoots
> href=" 1843d754-d1c6-4175-97bd-b60b58b8d362.entitlementcalculation# / "/>
> </diff:DiffModel>
>
> Regards,
> Jose
>
> "Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
> news:hem7r8$3j9$1@build.eclipse.org...
>> Hi Jose,
>>
>> Depending on the changes you made, it might be normal that EMF Compare
>> ignores the change to the local model. For example if you made the exact
>> same change between the remote and ancestor models, then there is in
>> fact no difference to be detected, let alone be merged.
>>
>> Could you describe the exact changes you made in each models?
>>
>> Laurent Goubet
>> Obeo
>>
>> Jose Hernandez wrote:
>>> Hi,
>>>
>>> I'm trying to merge the contents of two instances of the same model using
>>> a
>>> three (3) way merge after making a small change to each of the instaces
>>> but,
>>> I am finding that the merged model contains only one set of changes, e.g.
>>> the changes between ancestorEmfModel and remoteEmfModel. EMF compare is
>>> removing the changes made in localEmfModel. This is the code that I'm
>>> using:
>>>
>>> MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
>>> remoteEmfModel, ancestorEmfModel,
>>> Collections.<String, Object>
>>> singletonMap(MatchOptions.OPTION_IGNORE_ID,
>>> true));
>>> DiffModel diffModel = DiffService.doDiff(matchModel, false);
>>> MergeService.merge(new
>>> ArrayList<DiffElement>(diffModel.getOwnedElements()),
>>> true);
>>>
>>> Is there any way of ensuring that EMF compare does not remove the changes
>>> that took place between ancestorEmfModel and localEmfModel so that after
>>> a
>>> merge I end up with both sets of changes?
>>>
>>> Regards,
>>> Jose
>>>
>>>
>>
>
>


--------------080109020103090907090705
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------080109020103090907090705--
Re: [EMF Compare] Problem with three way merge [message #500680 is a reply to message #500641] Fri, 27 November 2009 13:44 Go to previous messageGo to next message
Jose Hernandez is currently offline Jose HernandezFriend
Messages: 32
Registered: July 2009
Member
Hi Laurent,

I'll prepare an example project demonstrating the issue and send it to you
as soon as I can.

Regards,
Jose

"Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
news:heo634$480$1@build.eclipse.org...
> Jose,
>
> You changed the same reference from both local and distant model
> differently, thus giving you a conflicting change. That doesn't really
> surprise me. What surprises me more is that merging doesn't seem to have
> changed any of the models in any way :'(.
>
> Could you provide us with the models you use, or are they confidential?
> Anyway, please raise a bug describing the issue on the eclipse bugzilla.
>
> Laurent Goubet
> Obeo
>
> Jose Hernandez wrote:
>> Hi Laurent,
>>
>> I added an element to the repository model and removed and element from
>> the
>> local model. More specifically, the model has a map and a list, I added
>> an
>> element to the map in the repository model and removed an element from
>> the
>> list in the local model and then attempted to combine the two. I seem to
>> be
>> getting a conflicting change in the map but this doesn't make sense since
>> the the map has only had an element added to it in one of the model
>> instances and not the other.
>>
>> If I merge right to left I get this diff model:
>>
>> <?xml version="1.0" encoding="Cp1252"?>
>> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
>> <ownedElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
>> <rightParent
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> <leftElement
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0 "/>
>> </subDiffElements>
>> <subDiffElements xsi:type="diff:ConflictingDiffElement">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
>> remote="true">
>> <rightParent
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>> <leftElement
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <leftParent
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
>> </subDiffElements>
>> </ownedElements>
>> <leftRoots
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>> <rightRoots
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
>> <ancestorRoots
>> href=" 423a8e75-1832-43b7-8fd8-b01179fdf2dd.entitlementcalculation# / "/>
>> </diff:DiffModel>
>>
>> and if I merge left to right I get this:
>>
>> <?xml version="1.0" encoding="Cp1252"?>
>> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
>> <ownedElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:ConflictingDiffElement">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
>> remote="true">
>> <rightParent
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>> <leftElement
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <leftParent
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
>> <rightParent
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> <leftElement
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
>> </subDiffElements>
>> </ownedElements>
>> <leftRoots
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>> <rightRoots
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
>> <ancestorRoots
>> href=" 1843d754-d1c6-4175-97bd-b60b58b8d362.entitlementcalculation# / "/>
>> </diff:DiffModel>
>>
>> Regards,
>> Jose
>>
>> "Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
>> news:hem7r8$3j9$1@build.eclipse.org...
>>> Hi Jose,
>>>
>>> Depending on the changes you made, it might be normal that EMF Compare
>>> ignores the change to the local model. For example if you made the exact
>>> same change between the remote and ancestor models, then there is in
>>> fact no difference to be detected, let alone be merged.
>>>
>>> Could you describe the exact changes you made in each models?
>>>
>>> Laurent Goubet
>>> Obeo
>>>
>>> Jose Hernandez wrote:
>>>> Hi,
>>>>
>>>> I'm trying to merge the contents of two instances of the same model
>>>> using
>>>> a
>>>> three (3) way merge after making a small change to each of the instaces
>>>> but,
>>>> I am finding that the merged model contains only one set of changes,
>>>> e.g.
>>>> the changes between ancestorEmfModel and remoteEmfModel. EMF compare
>>>> is
>>>> removing the changes made in localEmfModel. This is the code that I'm
>>>> using:
>>>>
>>>> MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
>>>> remoteEmfModel, ancestorEmfModel,
>>>> Collections.<String, Object>
>>>> singletonMap(MatchOptions.OPTION_IGNORE_ID,
>>>> true));
>>>> DiffModel diffModel = DiffService.doDiff(matchModel, false);
>>>> MergeService.merge(new
>>>> ArrayList<DiffElement>(diffModel.getOwnedElements()),
>>>> true);
>>>>
>>>> Is there any way of ensuring that EMF compare does not remove the
>>>> changes
>>>> that took place between ancestorEmfModel and localEmfModel so that
>>>> after
>>>> a
>>>> merge I end up with both sets of changes?
>>>>
>>>> Regards,
>>>> Jose
>>>>
>>>>
>>>
>>
>>
>
>
Re: [EMF Compare] Problem with three way merge [message #500708 is a reply to message #500680] Fri, 27 November 2009 15:48 Go to previous messageGo to next message
Jose Hernandez is currently offline Jose HernandezFriend
Messages: 32
Registered: July 2009
Member
Hi Laurent,

Please find a small test case attached. All you need to do is run the
LibraryExample class from eclipse as a Java application.
The test program sends all its output to the console.

Regards
Jose

"Jose Hernandez" <jose.hernandez@smartstream-stp.com> wrote in message
news:heol44$5i5$1@build.eclipse.org...
> Hi Laurent,
>
> I'll prepare an example project demonstrating the issue and send it to you
> as soon as I can.
>
> Regards,
> Jose
>
> "Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
> news:heo634$480$1@build.eclipse.org...
>> Jose,
>>
>> You changed the same reference from both local and distant model
>> differently, thus giving you a conflicting change. That doesn't really
>> surprise me. What surprises me more is that merging doesn't seem to have
>> changed any of the models in any way :'(.
>>
>> Could you provide us with the models you use, or are they confidential?
>> Anyway, please raise a bug describing the issue on the eclipse bugzilla.
>>
>> Laurent Goubet
>> Obeo
>>
>> Jose Hernandez wrote:
>>> Hi Laurent,
>>>
>>> I added an element to the repository model and removed and element from
>>> the
>>> local model. More specifically, the model has a map and a list, I added
>>> an
>>> element to the map in the repository model and removed an element from
>>> the
>>> list in the local model and then attempted to combine the two. I seem
>>> to
>>> be
>>> getting a conflicting change in the map but this doesn't make sense
>>> since
>>> the the map has only had an element added to it in one of the model
>>> instances and not the other.
>>>
>>> If I merge right to left I get this diff model:
>>>
>>> <?xml version="1.0" encoding="Cp1252"?>
>>> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
>>> <ownedElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
>>> <rightParent
>>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>>> <leftElement
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
>>> </subDiffElements>
>>> <rightParent
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>>> </subDiffElements>
>>> <rightParent
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0 "/>
>>> </subDiffElements>
>>> <subDiffElements xsi:type="diff:ConflictingDiffElement">
>>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
>>> remote="true">
>>> <rightParent
>>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>>> <leftElement
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
>>> </subDiffElements>
>>> <leftParent
>>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>>> <rightParent
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
>>> </subDiffElements>
>>> <rightParent
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
>>> </subDiffElements>
>>> </ownedElements>
>>> <leftRoots
>>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>>> <rightRoots
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
>>> <ancestorRoots
>>> href=" 423a8e75-1832-43b7-8fd8-b01179fdf2dd.entitlementcalculation# / "/>
>>> </diff:DiffModel>
>>>
>>> and if I merge left to right I get this:
>>>
>>> <?xml version="1.0" encoding="Cp1252"?>
>>> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
>>> <ownedElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:ConflictingDiffElement">
>>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
>>> remote="true">
>>> <rightParent
>>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>>> <leftElement
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
>>> </subDiffElements>
>>> <leftParent
>>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>>> <rightParent
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
>>> </subDiffElements>
>>> <subDiffElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
>>> <rightParent
>>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>>> <leftElement
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
>>> </subDiffElements>
>>> <rightParent
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>>> </subDiffElements>
>>> <rightParent
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0 "/>
>>> </subDiffElements>
>>> <rightParent
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
>>> </subDiffElements>
>>> </ownedElements>
>>> <leftRoots
>>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>>> <rightRoots
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
>>> <ancestorRoots
>>> href=" 1843d754-d1c6-4175-97bd-b60b58b8d362.entitlementcalculation# / "/>
>>> </diff:DiffModel>
>>>
>>> Regards,
>>> Jose
>>>
>>> "Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
>>> news:hem7r8$3j9$1@build.eclipse.org...
>>>> Hi Jose,
>>>>
>>>> Depending on the changes you made, it might be normal that EMF Compare
>>>> ignores the change to the local model. For example if you made the
>>>> exact
>>>> same change between the remote and ancestor models, then there is in
>>>> fact no difference to be detected, let alone be merged.
>>>>
>>>> Could you describe the exact changes you made in each models?
>>>>
>>>> Laurent Goubet
>>>> Obeo
>>>>
>>>> Jose Hernandez wrote:
>>>>> Hi,
>>>>>
>>>>> I'm trying to merge the contents of two instances of the same model
>>>>> using
>>>>> a
>>>>> three (3) way merge after making a small change to each of the
>>>>> instaces
>>>>> but,
>>>>> I am finding that the merged model contains only one set of changes,
>>>>> e.g.
>>>>> the changes between ancestorEmfModel and remoteEmfModel. EMF compare
>>>>> is
>>>>> removing the changes made in localEmfModel. This is the code that I'm
>>>>> using:
>>>>>
>>>>> MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
>>>>> remoteEmfModel, ancestorEmfModel,
>>>>> Collections.<String, Object>
>>>>> singletonMap(MatchOptions.OPTION_IGNORE_ID,
>>>>> true));
>>>>> DiffModel diffModel = DiffService.doDiff(matchModel, false);
>>>>> MergeService.merge(new
>>>>> ArrayList<DiffElement>(diffModel.getOwnedElements()),
>>>>> true);
>>>>>
>>>>> Is there any way of ensuring that EMF compare does not remove the
>>>>> changes
>>>>> that took place between ancestorEmfModel and localEmfModel so that
>>>>> after
>>>>> a
>>>>> merge I end up with both sets of changes?
>>>>>
>>>>> Regards,
>>>>> Jose
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>>
>
>


Re: [EMF Compare] Problem with three way merge [message #500925 is a reply to message #500641] Mon, 30 November 2009 10:25 Go to previous message
Jose Hernandez is currently offline Jose HernandezFriend
Messages: 32
Registered: July 2009
Member
Hi Laurent,

Bug raised as per request
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=296442)

Regards,
Jose

"Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
news:heo634$480$1@build.eclipse.org...
> Jose,
>
> You changed the same reference from both local and distant model
> differently, thus giving you a conflicting change. That doesn't really
> surprise me. What surprises me more is that merging doesn't seem to have
> changed any of the models in any way :'(.
>
> Could you provide us with the models you use, or are they confidential?
> Anyway, please raise a bug describing the issue on the eclipse bugzilla.
>
> Laurent Goubet
> Obeo
>
> Jose Hernandez wrote:
>> Hi Laurent,
>>
>> I added an element to the repository model and removed and element from
>> the
>> local model. More specifically, the model has a map and a list, I added
>> an
>> element to the map in the repository model and removed an element from
>> the
>> list in the local model and then attempted to combine the two. I seem to
>> be
>> getting a conflicting change in the map but this doesn't make sense since
>> the the map has only had an element added to it in one of the model
>> instances and not the other.
>>
>> If I merge right to left I get this diff model:
>>
>> <?xml version="1.0" encoding="Cp1252"?>
>> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
>> <ownedElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
>> <rightParent
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> <leftElement
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0 "/>
>> </subDiffElements>
>> <subDiffElements xsi:type="diff:ConflictingDiffElement">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
>> remote="true">
>> <rightParent
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>> <leftElement
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <leftParent
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
>> </subDiffElements>
>> </ownedElements>
>> <leftRoots
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>> <rightRoots
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
>> <ancestorRoots
>> href=" 423a8e75-1832-43b7-8fd8-b01179fdf2dd.entitlementcalculation# / "/>
>> </diff:DiffModel>
>>
>> and if I merge left to right I get this:
>>
>> <?xml version="1.0" encoding="Cp1252"?>
>> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
>> <ownedElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:ConflictingDiffElement">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
>> remote="true">
>> <rightParent
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>> <leftElement
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <leftParent
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
>> <rightParent
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> <leftElement
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
>> </subDiffElements>
>> </ownedElements>
>> <leftRoots
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>> <rightRoots
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
>> <ancestorRoots
>> href=" 1843d754-d1c6-4175-97bd-b60b58b8d362.entitlementcalculation# / "/>
>> </diff:DiffModel>
>>
>> Regards,
>> Jose
>>
>> "Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
>> news:hem7r8$3j9$1@build.eclipse.org...
>>> Hi Jose,
>>>
>>> Depending on the changes you made, it might be normal that EMF Compare
>>> ignores the change to the local model. For example if you made the exact
>>> same change between the remote and ancestor models, then there is in
>>> fact no difference to be detected, let alone be merged.
>>>
>>> Could you describe the exact changes you made in each models?
>>>
>>> Laurent Goubet
>>> Obeo
>>>
>>> Jose Hernandez wrote:
>>>> Hi,
>>>>
>>>> I'm trying to merge the contents of two instances of the same model
>>>> using
>>>> a
>>>> three (3) way merge after making a small change to each of the instaces
>>>> but,
>>>> I am finding that the merged model contains only one set of changes,
>>>> e.g.
>>>> the changes between ancestorEmfModel and remoteEmfModel. EMF compare
>>>> is
>>>> removing the changes made in localEmfModel. This is the code that I'm
>>>> using:
>>>>
>>>> MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
>>>> remoteEmfModel, ancestorEmfModel,
>>>> Collections.<String, Object>
>>>> singletonMap(MatchOptions.OPTION_IGNORE_ID,
>>>> true));
>>>> DiffModel diffModel = DiffService.doDiff(matchModel, false);
>>>> MergeService.merge(new
>>>> ArrayList<DiffElement>(diffModel.getOwnedElements()),
>>>> true);
>>>>
>>>> Is there any way of ensuring that EMF compare does not remove the
>>>> changes
>>>> that took place between ancestorEmfModel and localEmfModel so that
>>>> after
>>>> a
>>>> merge I end up with both sets of changes?
>>>>
>>>> Regards,
>>>> Jose
>>>>
>>>>
>>>
>>
>>
>
>
Re: [EMF Compare] Problem with three way merge [message #621619 is a reply to message #500539] Thu, 26 November 2009 15:45 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050902020100060901020206
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jose,

Depending on the changes you made, it might be normal that EMF Compare
ignores the change to the local model. For example if you made the exact
same change between the remote and ancestor models, then there is in
fact no difference to be detected, let alone be merged.

Could you describe the exact changes you made in each models?

Laurent Goubet
Obeo

Jose Hernandez wrote:
> Hi,
>
> I'm trying to merge the contents of two instances of the same model using a
> three (3) way merge after making a small change to each of the instaces but,
> I am finding that the merged model contains only one set of changes, e.g.
> the changes between ancestorEmfModel and remoteEmfModel. EMF compare is
> removing the changes made in localEmfModel. This is the code that I'm
> using:
>
> MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
> remoteEmfModel, ancestorEmfModel,
> Collections.<String, Object> singletonMap(MatchOptions.OPTION_IGNORE_ID,
> true));
> DiffModel diffModel = DiffService.doDiff(matchModel, false);
> MergeService.merge(new ArrayList<DiffElement>(diffModel.getOwnedElements()),
> true);
>
> Is there any way of ensuring that EMF compare does not remove the changes
> that took place between ancestorEmfModel and localEmfModel so that after a
> merge I end up with both sets of changes?
>
> Regards,
> Jose
>
>


--------------050902020100060901020206
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------050902020100060901020206--
Re: [EMF Compare] Problem with three way merge [message #621620 is a reply to message #500546] Thu, 26 November 2009 16:31 Go to previous message
Jose Hernandez is currently offline Jose HernandezFriend
Messages: 32
Registered: July 2009
Member
Hi Laurent,

I added an element to the repository model and removed and element from the
local model. More specifically, the model has a map and a list, I added an
element to the map in the repository model and removed an element from the
list in the local model and then attempted to combine the two. I seem to be
getting a conflicting change in the map but this doesn't make sense since
the the map has only had an element added to it in one of the model
instances and not the other.

If I merge right to left I get this diff model:

<?xml version="1.0" encoding="Cp1252"?>
<diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
<ownedElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
<rightParent
href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
<leftElement
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
</subDiffElements>
<rightParent
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
</subDiffElements>
<rightParent
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0 "/>
</subDiffElements>
<subDiffElements xsi:type="diff:ConflictingDiffElement">
<subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
remote="true">
<rightParent
href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
<leftElement
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
</subDiffElements>
<leftParent
href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
<rightParent
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
</subDiffElements>
<rightParent
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
</subDiffElements>
</ownedElements>
<leftRoots
href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
<rightRoots
href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
<ancestorRoots
href=" 423a8e75-1832-43b7-8fd8-b01179fdf2dd.entitlementcalculation# / "/>
</diff:DiffModel>

and if I merge left to right I get this:

<?xml version="1.0" encoding="Cp1252"?>
<diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
<ownedElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:ConflictingDiffElement">
<subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
remote="true">
<rightParent
href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
<leftElement
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
</subDiffElements>
<leftParent
href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
<rightParent
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
</subDiffElements>
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
<rightParent
href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
<leftElement
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
</subDiffElements>
<rightParent
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
</subDiffElements>
<rightParent
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0 "/>
</subDiffElements>
<rightParent
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
</subDiffElements>
</ownedElements>
<leftRoots
href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
<rightRoots
href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
<ancestorRoots
href=" 1843d754-d1c6-4175-97bd-b60b58b8d362.entitlementcalculation# / "/>
</diff:DiffModel>

Regards,
Jose

"Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
news:hem7r8$3j9$1@build.eclipse.org...
> Hi Jose,
>
> Depending on the changes you made, it might be normal that EMF Compare
> ignores the change to the local model. For example if you made the exact
> same change between the remote and ancestor models, then there is in
> fact no difference to be detected, let alone be merged.
>
> Could you describe the exact changes you made in each models?
>
> Laurent Goubet
> Obeo
>
> Jose Hernandez wrote:
>> Hi,
>>
>> I'm trying to merge the contents of two instances of the same model using
>> a
>> three (3) way merge after making a small change to each of the instaces
>> but,
>> I am finding that the merged model contains only one set of changes, e.g.
>> the changes between ancestorEmfModel and remoteEmfModel. EMF compare is
>> removing the changes made in localEmfModel. This is the code that I'm
>> using:
>>
>> MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
>> remoteEmfModel, ancestorEmfModel,
>> Collections.<String, Object>
>> singletonMap(MatchOptions.OPTION_IGNORE_ID,
>> true));
>> DiffModel diffModel = DiffService.doDiff(matchModel, false);
>> MergeService.merge(new
>> ArrayList<DiffElement>(diffModel.getOwnedElements()),
>> true);
>>
>> Is there any way of ensuring that EMF compare does not remove the changes
>> that took place between ancestorEmfModel and localEmfModel so that after
>> a
>> merge I end up with both sets of changes?
>>
>> Regards,
>> Jose
>>
>>
>
>
Re: [EMF Compare] Problem with three way merge [message #621623 is a reply to message #500554] Fri, 27 November 2009 09:28 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1893
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080109020103090907090705
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Jose,

You changed the same reference from both local and distant model
differently, thus giving you a conflicting change. That doesn't really
surprise me. What surprises me more is that merging doesn't seem to have
changed any of the models in any way :'(.

Could you provide us with the models you use, or are they confidential?
Anyway, please raise a bug describing the issue on the eclipse bugzilla.

Laurent Goubet
Obeo

Jose Hernandez wrote:
> Hi Laurent,
>
> I added an element to the repository model and removed and element from the
> local model. More specifically, the model has a map and a list, I added an
> element to the map in the repository model and removed an element from the
> list in the local model and then attempted to combine the two. I seem to be
> getting a conflicting change in the map but this doesn't make sense since
> the the map has only had an element added to it in one of the model
> instances and not the other.
>
> If I merge right to left I get this diff model:
>
> <?xml version="1.0" encoding="Cp1252"?>
> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
> <ownedElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
> <rightParent
> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
> <leftElement
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
> </subDiffElements>
> <rightParent
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
> </subDiffElements>
> <rightParent
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0 "/>
> </subDiffElements>
> <subDiffElements xsi:type="diff:ConflictingDiffElement">
> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
> remote="true">
> <rightParent
> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
> <leftElement
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
> </subDiffElements>
> <leftParent
> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
> <rightParent
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
> </subDiffElements>
> <rightParent
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
> </subDiffElements>
> </ownedElements>
> <leftRoots
> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
> <rightRoots
> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
> <ancestorRoots
> href=" 423a8e75-1832-43b7-8fd8-b01179fdf2dd.entitlementcalculation# / "/>
> </diff:DiffModel>
>
> and if I merge left to right I get this:
>
> <?xml version="1.0" encoding="Cp1252"?>
> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
> <ownedElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:ConflictingDiffElement">
> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
> remote="true">
> <rightParent
> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
> <leftElement
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
> </subDiffElements>
> <leftParent
> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
> <rightParent
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
> </subDiffElements>
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
> <rightParent
> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
> <leftElement
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
> </subDiffElements>
> <rightParent
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
> </subDiffElements>
> <rightParent
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0 "/>
> </subDiffElements>
> <rightParent
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
> </subDiffElements>
> </ownedElements>
> <leftRoots
> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
> <rightRoots
> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
> <ancestorRoots
> href=" 1843d754-d1c6-4175-97bd-b60b58b8d362.entitlementcalculation# / "/>
> </diff:DiffModel>
>
> Regards,
> Jose
>
> "Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
> news:hem7r8$3j9$1@build.eclipse.org...
>> Hi Jose,
>>
>> Depending on the changes you made, it might be normal that EMF Compare
>> ignores the change to the local model. For example if you made the exact
>> same change between the remote and ancestor models, then there is in
>> fact no difference to be detected, let alone be merged.
>>
>> Could you describe the exact changes you made in each models?
>>
>> Laurent Goubet
>> Obeo
>>
>> Jose Hernandez wrote:
>>> Hi,
>>>
>>> I'm trying to merge the contents of two instances of the same model using
>>> a
>>> three (3) way merge after making a small change to each of the instaces
>>> but,
>>> I am finding that the merged model contains only one set of changes, e.g.
>>> the changes between ancestorEmfModel and remoteEmfModel. EMF compare is
>>> removing the changes made in localEmfModel. This is the code that I'm
>>> using:
>>>
>>> MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
>>> remoteEmfModel, ancestorEmfModel,
>>> Collections.<String, Object>
>>> singletonMap(MatchOptions.OPTION_IGNORE_ID,
>>> true));
>>> DiffModel diffModel = DiffService.doDiff(matchModel, false);
>>> MergeService.merge(new
>>> ArrayList<DiffElement>(diffModel.getOwnedElements()),
>>> true);
>>>
>>> Is there any way of ensuring that EMF compare does not remove the changes
>>> that took place between ancestorEmfModel and localEmfModel so that after
>>> a
>>> merge I end up with both sets of changes?
>>>
>>> Regards,
>>> Jose
>>>
>>>
>>
>
>


--------------080109020103090907090705
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------080109020103090907090705--
Re: [EMF Compare] Problem with three way merge [message #621851 is a reply to message #500641] Fri, 27 November 2009 13:44 Go to previous message
Jose Hernandez is currently offline Jose HernandezFriend
Messages: 32
Registered: July 2009
Member
Hi Laurent,

I'll prepare an example project demonstrating the issue and send it to you
as soon as I can.

Regards,
Jose

"Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
news:heo634$480$1@build.eclipse.org...
> Jose,
>
> You changed the same reference from both local and distant model
> differently, thus giving you a conflicting change. That doesn't really
> surprise me. What surprises me more is that merging doesn't seem to have
> changed any of the models in any way :'(.
>
> Could you provide us with the models you use, or are they confidential?
> Anyway, please raise a bug describing the issue on the eclipse bugzilla.
>
> Laurent Goubet
> Obeo
>
> Jose Hernandez wrote:
>> Hi Laurent,
>>
>> I added an element to the repository model and removed and element from
>> the
>> local model. More specifically, the model has a map and a list, I added
>> an
>> element to the map in the repository model and removed an element from
>> the
>> list in the local model and then attempted to combine the two. I seem to
>> be
>> getting a conflicting change in the map but this doesn't make sense since
>> the the map has only had an element added to it in one of the model
>> instances and not the other.
>>
>> If I merge right to left I get this diff model:
>>
>> <?xml version="1.0" encoding="Cp1252"?>
>> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
>> <ownedElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
>> <rightParent
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> <leftElement
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0 "/>
>> </subDiffElements>
>> <subDiffElements xsi:type="diff:ConflictingDiffElement">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
>> remote="true">
>> <rightParent
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>> <leftElement
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <leftParent
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
>> </subDiffElements>
>> </ownedElements>
>> <leftRoots
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>> <rightRoots
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
>> <ancestorRoots
>> href=" 423a8e75-1832-43b7-8fd8-b01179fdf2dd.entitlementcalculation# / "/>
>> </diff:DiffModel>
>>
>> and if I merge left to right I get this:
>>
>> <?xml version="1.0" encoding="Cp1252"?>
>> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
>> <ownedElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:ConflictingDiffElement">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
>> remote="true">
>> <rightParent
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>> <leftElement
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <leftParent
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
>> <rightParent
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> <leftElement
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
>> </subDiffElements>
>> </ownedElements>
>> <leftRoots
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>> <rightRoots
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
>> <ancestorRoots
>> href=" 1843d754-d1c6-4175-97bd-b60b58b8d362.entitlementcalculation# / "/>
>> </diff:DiffModel>
>>
>> Regards,
>> Jose
>>
>> "Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
>> news:hem7r8$3j9$1@build.eclipse.org...
>>> Hi Jose,
>>>
>>> Depending on the changes you made, it might be normal that EMF Compare
>>> ignores the change to the local model. For example if you made the exact
>>> same change between the remote and ancestor models, then there is in
>>> fact no difference to be detected, let alone be merged.
>>>
>>> Could you describe the exact changes you made in each models?
>>>
>>> Laurent Goubet
>>> Obeo
>>>
>>> Jose Hernandez wrote:
>>>> Hi,
>>>>
>>>> I'm trying to merge the contents of two instances of the same model
>>>> using
>>>> a
>>>> three (3) way merge after making a small change to each of the instaces
>>>> but,
>>>> I am finding that the merged model contains only one set of changes,
>>>> e.g.
>>>> the changes between ancestorEmfModel and remoteEmfModel. EMF compare
>>>> is
>>>> removing the changes made in localEmfModel. This is the code that I'm
>>>> using:
>>>>
>>>> MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
>>>> remoteEmfModel, ancestorEmfModel,
>>>> Collections.<String, Object>
>>>> singletonMap(MatchOptions.OPTION_IGNORE_ID,
>>>> true));
>>>> DiffModel diffModel = DiffService.doDiff(matchModel, false);
>>>> MergeService.merge(new
>>>> ArrayList<DiffElement>(diffModel.getOwnedElements()),
>>>> true);
>>>>
>>>> Is there any way of ensuring that EMF compare does not remove the
>>>> changes
>>>> that took place between ancestorEmfModel and localEmfModel so that
>>>> after
>>>> a
>>>> merge I end up with both sets of changes?
>>>>
>>>> Regards,
>>>> Jose
>>>>
>>>>
>>>
>>
>>
>
>
Re: [EMF Compare] Problem with three way merge [message #621855 is a reply to message #500680] Fri, 27 November 2009 15:48 Go to previous message
Jose Hernandez is currently offline Jose HernandezFriend
Messages: 32
Registered: July 2009
Member
Hi Laurent,

Please find a small test case attached. All you need to do is run the
LibraryExample class from eclipse as a Java application.
The test program sends all its output to the console.

Regards
Jose

"Jose Hernandez" <jose.hernandez@smartstream-stp.com> wrote in message
news:heol44$5i5$1@build.eclipse.org...
> Hi Laurent,
>
> I'll prepare an example project demonstrating the issue and send it to you
> as soon as I can.
>
> Regards,
> Jose
>
> "Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
> news:heo634$480$1@build.eclipse.org...
>> Jose,
>>
>> You changed the same reference from both local and distant model
>> differently, thus giving you a conflicting change. That doesn't really
>> surprise me. What surprises me more is that merging doesn't seem to have
>> changed any of the models in any way :'(.
>>
>> Could you provide us with the models you use, or are they confidential?
>> Anyway, please raise a bug describing the issue on the eclipse bugzilla.
>>
>> Laurent Goubet
>> Obeo
>>
>> Jose Hernandez wrote:
>>> Hi Laurent,
>>>
>>> I added an element to the repository model and removed and element from
>>> the
>>> local model. More specifically, the model has a map and a list, I added
>>> an
>>> element to the map in the repository model and removed an element from
>>> the
>>> list in the local model and then attempted to combine the two. I seem
>>> to
>>> be
>>> getting a conflicting change in the map but this doesn't make sense
>>> since
>>> the the map has only had an element added to it in one of the model
>>> instances and not the other.
>>>
>>> If I merge right to left I get this diff model:
>>>
>>> <?xml version="1.0" encoding="Cp1252"?>
>>> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
>>> <ownedElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
>>> <rightParent
>>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>>> <leftElement
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
>>> </subDiffElements>
>>> <rightParent
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>>> </subDiffElements>
>>> <rightParent
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0 "/>
>>> </subDiffElements>
>>> <subDiffElements xsi:type="diff:ConflictingDiffElement">
>>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
>>> remote="true">
>>> <rightParent
>>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>>> <leftElement
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
>>> </subDiffElements>
>>> <leftParent
>>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>>> <rightParent
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
>>> </subDiffElements>
>>> <rightParent
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
>>> </subDiffElements>
>>> </ownedElements>
>>> <leftRoots
>>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>>> <rightRoots
>>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
>>> <ancestorRoots
>>> href=" 423a8e75-1832-43b7-8fd8-b01179fdf2dd.entitlementcalculation# / "/>
>>> </diff:DiffModel>
>>>
>>> and if I merge left to right I get this:
>>>
>>> <?xml version="1.0" encoding="Cp1252"?>
>>> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
>>> <ownedElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:ConflictingDiffElement">
>>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
>>> remote="true">
>>> <rightParent
>>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>>> <leftElement
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
>>> </subDiffElements>
>>> <leftParent
>>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>>> <rightParent
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
>>> </subDiffElements>
>>> <subDiffElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:DiffGroup">
>>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
>>> <rightParent
>>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>>> <leftElement
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
>>> </subDiffElements>
>>> <rightParent
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>>> </subDiffElements>
>>> <rightParent
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0 "/>
>>> </subDiffElements>
>>> <rightParent
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
>>> </subDiffElements>
>>> </ownedElements>
>>> <leftRoots
>>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>>> <rightRoots
>>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
>>> <ancestorRoots
>>> href=" 1843d754-d1c6-4175-97bd-b60b58b8d362.entitlementcalculation# / "/>
>>> </diff:DiffModel>
>>>
>>> Regards,
>>> Jose
>>>
>>> "Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
>>> news:hem7r8$3j9$1@build.eclipse.org...
>>>> Hi Jose,
>>>>
>>>> Depending on the changes you made, it might be normal that EMF Compare
>>>> ignores the change to the local model. For example if you made the
>>>> exact
>>>> same change between the remote and ancestor models, then there is in
>>>> fact no difference to be detected, let alone be merged.
>>>>
>>>> Could you describe the exact changes you made in each models?
>>>>
>>>> Laurent Goubet
>>>> Obeo
>>>>
>>>> Jose Hernandez wrote:
>>>>> Hi,
>>>>>
>>>>> I'm trying to merge the contents of two instances of the same model
>>>>> using
>>>>> a
>>>>> three (3) way merge after making a small change to each of the
>>>>> instaces
>>>>> but,
>>>>> I am finding that the merged model contains only one set of changes,
>>>>> e.g.
>>>>> the changes between ancestorEmfModel and remoteEmfModel. EMF compare
>>>>> is
>>>>> removing the changes made in localEmfModel. This is the code that I'm
>>>>> using:
>>>>>
>>>>> MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
>>>>> remoteEmfModel, ancestorEmfModel,
>>>>> Collections.<String, Object>
>>>>> singletonMap(MatchOptions.OPTION_IGNORE_ID,
>>>>> true));
>>>>> DiffModel diffModel = DiffService.doDiff(matchModel, false);
>>>>> MergeService.merge(new
>>>>> ArrayList<DiffElement>(diffModel.getOwnedElements()),
>>>>> true);
>>>>>
>>>>> Is there any way of ensuring that EMF compare does not remove the
>>>>> changes
>>>>> that took place between ancestorEmfModel and localEmfModel so that
>>>>> after
>>>>> a
>>>>> merge I end up with both sets of changes?
>>>>>
>>>>> Regards,
>>>>> Jose
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>>
>
>


Re: [EMF Compare] Problem with three way merge [message #621863 is a reply to message #500641] Mon, 30 November 2009 10:25 Go to previous message
Jose Hernandez is currently offline Jose HernandezFriend
Messages: 32
Registered: July 2009
Member
Hi Laurent,

Bug raised as per request
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=296442)

Regards,
Jose

"Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
news:heo634$480$1@build.eclipse.org...
> Jose,
>
> You changed the same reference from both local and distant model
> differently, thus giving you a conflicting change. That doesn't really
> surprise me. What surprises me more is that merging doesn't seem to have
> changed any of the models in any way :'(.
>
> Could you provide us with the models you use, or are they confidential?
> Anyway, please raise a bug describing the issue on the eclipse bugzilla.
>
> Laurent Goubet
> Obeo
>
> Jose Hernandez wrote:
>> Hi Laurent,
>>
>> I added an element to the repository model and removed and element from
>> the
>> local model. More specifically, the model has a map and a list, I added
>> an
>> element to the map in the repository model and removed an element from
>> the
>> list in the local model and then attempted to combine the two. I seem to
>> be
>> getting a conflicting change in the map but this doesn't make sense since
>> the the map has only had an element added to it in one of the model
>> instances and not the other.
>>
>> If I merge right to left I get this diff model:
>>
>> <?xml version="1.0" encoding="Cp1252"?>
>> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
>> <ownedElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
>> <rightParent
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> <leftElement
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@ruleList.0 "/>
>> </subDiffElements>
>> <subDiffElements xsi:type="diff:ConflictingDiffElement">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
>> remote="true">
>> <rightParent
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>> <leftElement
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <leftParent
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
>> </subDiffElements>
>> </ownedElements>
>> <leftRoots
>> href=" 31465cc3-d9c8-4c89-a200-07e34d671077.entitlementcalculation# / "/>
>> <rightRoots
>> href=" 20ad96b8-51fc-4317-af16-a6c428d0965a.entitlementcalculation# / "/>
>> <ancestorRoots
>> href=" 423a8e75-1832-43b7-8fd8-b01179fdf2dd.entitlementcalculation# / "/>
>> </diff:DiffModel>
>>
>> and if I merge left to right I get this:
>>
>> <?xml version="1.0" encoding="Cp1252"?>
>> <diff:DiffModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
>> <ownedElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:ConflictingDiffElement">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget"
>> remote="true">
>> <rightParent
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>> <leftElement
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <leftParent
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@decisionSetMap.17 "/>
>> </subDiffElements>
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:DiffGroup">
>> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
>> <rightParent
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> <leftElement
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1/@entitlementList .2 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0/@entitlementCalculationList.1 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# //@ruleList.0 "/>
>> </subDiffElements>
>> <rightParent
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
>> </subDiffElements>
>> </ownedElements>
>> <leftRoots
>> href=" 028f88b0-b72a-402e-937b-215a7373aace.entitlementcalculation# / "/>
>> <rightRoots
>> href=" 9449fc8e-d3e2-4008-8b90-6082f944e572.entitlementcalculation# / "/>
>> <ancestorRoots
>> href=" 1843d754-d1c6-4175-97bd-b60b58b8d362.entitlementcalculation# / "/>
>> </diff:DiffModel>
>>
>> Regards,
>> Jose
>>
>> "Laurent Goubet" <laurent.goubet@obeo.fr> wrote in message
>> news:hem7r8$3j9$1@build.eclipse.org...
>>> Hi Jose,
>>>
>>> Depending on the changes you made, it might be normal that EMF Compare
>>> ignores the change to the local model. For example if you made the exact
>>> same change between the remote and ancestor models, then there is in
>>> fact no difference to be detected, let alone be merged.
>>>
>>> Could you describe the exact changes you made in each models?
>>>
>>> Laurent Goubet
>>> Obeo
>>>
>>> Jose Hernandez wrote:
>>>> Hi,
>>>>
>>>> I'm trying to merge the contents of two instances of the same model
>>>> using
>>>> a
>>>> three (3) way merge after making a small change to each of the instaces
>>>> but,
>>>> I am finding that the merged model contains only one set of changes,
>>>> e.g.
>>>> the changes between ancestorEmfModel and remoteEmfModel. EMF compare
>>>> is
>>>> removing the changes made in localEmfModel. This is the code that I'm
>>>> using:
>>>>
>>>> MatchModel matchModel = MatchService.doContentMatch(localEmfModel,
>>>> remoteEmfModel, ancestorEmfModel,
>>>> Collections.<String, Object>
>>>> singletonMap(MatchOptions.OPTION_IGNORE_ID,
>>>> true));
>>>> DiffModel diffModel = DiffService.doDiff(matchModel, false);
>>>> MergeService.merge(new
>>>> ArrayList<DiffElement>(diffModel.getOwnedElements()),
>>>> true);
>>>>
>>>> Is there any way of ensuring that EMF compare does not remove the
>>>> changes
>>>> that took place between ancestorEmfModel and localEmfModel so that
>>>> after
>>>> a
>>>> merge I end up with both sets of changes?
>>>>
>>>> Regards,
>>>> Jose
>>>>
>>>>
>>>
>>
>>
>
>
Previous Topic:[EMF Compare] Multiple matches
Next Topic:Forward Cross References (Posted to wrong group. Answer in EMF forum)
Goto Forum:
  


Current Time: Wed Jun 23 10:20:10 GMT 2021

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

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

Back to the top