Merging file deletions in multi-file model [message #1750359] |
Tue, 20 December 2016 05:52  |
Eclipse User |
|
|
|
Hi,
I am using EMF Compare to handle model merging in my own EMF-based application. One problem that I am encountering is caused by the fact that my application serializes models in multiple files. This means that by deleting certain EObjects, it is possible that entire model files are removed from the file system.
My first impression is that EMF Compare cannot handle this case "out of the box", and may require some customization.
The behavior I am observing depends on whether the deletion is performed in the local or in the remote model. When deleting a file in the local model and making a change to that same file in the remote model, the compare editor does not start, reporting in a pop-up message that "There are no differences between the selected inputs".
I think at least some of this behavior could be due to my extension to CompareEditorInput. However, I'd like to ask if this type of conflict is currently supported by EMF Compare. For instance, is the RecursiveModelMerger designed to support this use case?
Cheers,
Vlad
|
|
|
Re: Merging file deletions in multi-file model [message #1750452 is a reply to message #1750359] |
Wed, 21 December 2016 03:49   |
Eclipse User |
|
|
|
Hi Vlad,
EMF Compare supports multi-file models, including moves across model files, deletions of model files on the local or remote side, etc. (see ResourceAttachmentChange). But so for, I only used this multi-file functionality together with EGit and the recursive model merge strategy in the EGit preferences. The model resolution preference should then be set accordingly, depending on how your models are structured. E.g., whether all connected models are in one project (project scope) or are distributed across multiple projects (workspace scope), etc.
I have never tried to support this use case outside of EGit. It should be doable, but may require some additional implementation. You might also want to have a look at the EMFResourceMappingMerger, which implements the multi-file merge based on the the Eclipse Team API.
Best wishes,
Philip
--
Philip Langer
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
[Updated on: Wed, 21 December 2016 03:50] by Moderator
|
|
|
|
|
Re: Merging file deletions in multi-file model [message #1752586 is a reply to message #1750926] |
Wed, 25 January 2017 05:56  |
Eclipse User |
|
|
|
Hi Philip,
Thank you very much for the previous answer.
Related to that, I have an additional question. I have implemented a custom merger extending org.eclipse.emf.compare.egit.internal.merge.RecursiveModelMerger. This merger is instantiated by a custom merge strategy extending org.eclipse.emf.compare.egit.internal.merge.StrategyRecursiveModel.
How can I programmatically configure EMF Compare to use my custom merger instead of the one it uses by default? I checked the developer documentation, but the section describing how to provide custom mergers is still under construction.
Thank you in advance!
Vlad
|
|
|
Powered by
FUDForum. Page generated in 0.25192 seconds