Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Complicated emf model and history(Complicated emf model and history)
Complicated emf model and history [message #1731503] Fri, 06 May 2016 10:02 Go to next message
Hleb Albau is currently offline Hleb AlbauFriend
Messages: 7
Registered: May 2016
Junior Member
Hi All,

I have a complicated emf model, that consists of one independent model A, and another model B, that contains references to values of model A. During some editing operations on B, both models(files) are saved. To resolve both models, i use org.eclipse.emf.compare.ide.ui.modelDependencyProvider extension point. But, as far as i understand in ComparisonScopeBuilder.java, that extension works only for comparison local files. Emf compare 3.2.0.

1) Is it possible to resolve both models for git revision?
2) Is it possible to resolve both models for file local history?

Thank in advance.
Re: Complicated emf model and history [message #1731930 is a reply to message #1731503] Wed, 11 May 2016 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,

Quote:
To resolve both models, i use org.eclipse.emf.compare.ide.ui.modelDependencyProvider extension point. But, as far as i understand in ComparisonScopeBuilder.java, that extension works only for comparison local files. Emf compare 3.2.0.


Actually it shouldn't be necessary to use the modelDependencyProvider if the models refer to each other (A <-- B). When A or B is compared, depending on the configured resolution scope in the EMF Compare preference "Resolution strategy", the model resolver will detect that one refers to the other and include both in the comparison scope. The modelDependencyProvider is only used when you want to have both models in the scope also if they don't refer to each other.

Quote:
1) Is it possible to resolve both models for git revision?


Yes... with limitations: the model resolution is only performed when comparing git revisions (branches, tags, commits, etc.) with the workspace, and the model dependency detection will mainly be performed on the workspace side. When comparing with the workspace, the model resolution works roughly the following way: it will resolve all model dependencies in the local workspace (-> list of dependent model files), then it will check for each of these model files if there are additional dependencies on the remote side (-> potentially additional dependencies, such as new model files), and then it will go back to the local side and see if these additional dependencies imply even more dependencies in the local workspace. Finally, they are all put into the comparison scope.

Quote:
2) Is it possible to resolve both models for file local history?


No, unfortunately not.

Hope this helps,

Philip


--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Complicated emf model and history [message #1731947 is a reply to message #1731930] Wed, 11 May 2016 08:41 Go to previous messageGo to next message
Hleb Albau is currently offline Hleb AlbauFriend
Messages: 7
Registered: May 2016
Junior Member
Hi, thank you for answers.

Quote:
Yes... with limitations: the model resolution is only performed when comparing git revisions (branches, tags, commits, etc.) with the workspace, and the model dependency detection will mainly be performed on the workspace side. When comparing with the workspace, the model resolution works roughly the following way: it will resolve all model dependencies in the local workspace (-> list of dependent model files), then it will check for each of these model files if there are additional dependencies on the remote side (-> potentially additional dependencies, such as new model files), and then it will go back to the local side and see if these additional dependencies imply even more dependencies in the local workspace. Finally, they are all put into the comparison scope.


(A <-- B)
So, as i understand, if some value in model A was changed and committed on remote, when comparing this revision and workspace on B files, this changes will be invisible?(instead of revision A, in scope will be workspace A)?

Hleb
Re: Complicated emf model and history [message #1732549 is a reply to message #1731947] Wed, 18 May 2016 01:05 Go to previous messageGo to next message
Philip Langer is currently offline Philip LangerFriend
Messages: 83
Registered: March 2015
Location: Vienna, Austria
Member

Quote:
(A <-- B)
So, as i understand, if some value in model A was changed and committed on remote, when comparing this revision and workspace on B files, this changes will be invisible?(instead of revision A, in scope will be workspace A)?


Yes, given that also in the workspace version the model file B referenced model file A. And of course, assuming that the resolution scope configured in the preferences of EMF Compare doesn't cut away the model file A.

Best wishes,

Philip


--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Complicated emf model and history [message #1732960 is a reply to message #1732549] Mon, 23 May 2016 12:55 Go to previous messageGo to next message
Hleb Albau is currently offline Hleb AlbauFriend
Messages: 7
Registered: May 2016
Junior Member
Is there any technical reason of such solution? Or may be we can research solution and provide patch?

Thanks,
Hleb

Re: Complicated emf model and history [message #1733065 is a reply to message #1732960] Tue, 24 May 2016 08:03 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1857
Registered: July 2009
Senior Member
Hi,

There seems to be enough information to understand your use case, but it's all over the place, so I'll try and summarize it, please correct any mistake in my assumption :

- You have a model that is logically comprised of two physical files A and B. The link between the two is only from B to A.
- The versions look something like this :
commit1 -----> commit2
A1-B1      -----> A2

i.e. files A and B were commited together in a first commit, and only A changed in the second one.
- Your local version is on "commit1", one commit behind the remote.
- You've modified your local version of B and now have version B2 of that file.

In such a scenario, if you launch a comparison on B with commit2, the local side will be A1-B2 (modified version of B and unmodified version of A), the ancestor will be A1-B1 (commit1) and the remote version will be A2-B1 : since we know from the local side that "A" is in your logical model, we will resolve "A2" since it is the version of that file on the version you're comparing with.

All in all, please tell us if something doesn't work as expected instead of trying to work it out on an imaginary scenario, as that will be much more clear for both of us Smile.

Regards,

Laurent Goubet
Obeo
Re: Complicated emf model and history [message #1733191 is a reply to message #1733065] Wed, 25 May 2016 09:09 Go to previous messageGo to next message
Hleb Albau is currently offline Hleb AlbauFriend
Messages: 7
Registered: May 2016
Junior Member
Hi Laurent,

First of all, thank you for clear answer. Yes, it works as expected. Sorry for taking your time, it was my misunderstanding of Philip answers.

Best wishes,

Hleb
Re: Complicated emf model and history [message #1733408 is a reply to message #1733191] Fri, 27 May 2016 09:41 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1857
Registered: July 2009
Senior Member
Thanks for the heads up Hleb!

Laurent Goubet
Obeo
Previous Topic:[EMF Compare] Problem with EMF Synchronization Model
Next Topic:[EMF Compare] Comparing ecore files
Goto Forum:
  


Current Time: Wed Jun 20 21:10:51 GMT 2018

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

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

Back to the top