Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Load resources from revision control
Load resources from revision control [message #1835821] Mon, 14 December 2020 10:55 Go to next message
Janik S is currently offline Janik SFriend
Messages: 12
Registered: November 2017
Junior Member
Hey guys,

we are struggling with a proper integration of the compare feature with the different repository providers. We already had problems with the comparison for streams fetched from Perforce in the past and fixed these with a workaround in a custom IStoragePathProvider. This implementation checks if the stream path is a valid workspace path (which actually shouldn't be required) and if it is not, it will massage it a little bit - else EMF compare would run into some IllegalArgumentException in the synchronization model. So e.g. /starting.vdksys needed to be changed to P4/starting.vdksys.

We now hit another issue with comparisons against git streams, the problem here is slightly different. The jump from IStorage from the editor input to URI for loading the resource messes up the creation of the correct resource. It falls back to the default resource factory (xmi) and hence fails to load our models. This is because of the creation of the URI:
org.eclipse.egit.core.internal.storage.CommitBlobStorage@fa10bb54 -> "starting/starting.vdksys b567762"
The git suffix in the full path messes up the lookup of the resource factory by file extension in NotLoadingResourceSet.demandCreateResource(uri).

Now my question, what would be the best way to fix this and is there a way to fix it for _any_ repository provided IStorage?

I stumbled over this enhancement by Ed in EditUIUtil to support loading from the storage's getContents:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=434808
https://git.eclipse.org/c/emf/org.eclipse.emf.git/commit/?id=a77a5ec24411151dc1dc9754f4edde9a441fb58e

Would something similar be suitable here? Or is "another IStoragePathProvider" approach better here to make the resource factory registry find the correct resource type again? I see that sooner or later we would need more workarounds for similar issues - maybe somebody already fixed this in an elegant way.

Thanks
Janik
Re: Load resources from revision control [message #1836469 is a reply to message #1835821] Tue, 05 January 2021 08:14 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1892
Registered: July 2009
Senior Member
Hello Janik,

Could you ensure you have installed the EGit integration for EMF Compare? You shouldn't have issues comparing with git commits since this is one of the VCS supported by EMF Compare (as opposed to perforce).

You can double check that the plugin "org.eclipse.emf.compare.egit" is installed in your eclipse, or from the update site (latest is 3.3.13 from https://download.eclipse.org/modeling/emf/compare/updates/releases/3.3/R202011241436/ ), ensure you have installed the feature "Model comparison (EMF Compare) - EGit support".

Laurent Goubet
Obeo
Previous Topic:AbstractChangeFactory.fillRequiredDifferences() may cause circular dependencies
Next Topic:Overriding the Model Resolver: impossible?
Goto Forum:
  


Current Time: Sun Jun 13 03:35:03 GMT 2021

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

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

Back to the top