Community
Participate
Working Groups
Right-clicking a resource in the workspace and selecting "Replace With > History..." pops up a dialog displaying all distinct revision of that file. A double-click on any of these revisions triggers a comparison and displays the changes between the current version of the file and the selected revision of that file. Problem is : this action does not consider logical models for the comparison. If the file is part of a model (as returned by the ModelProvider), its whole model should be taken into account for the comparison. Furthermore, the logical model should be taken into account for the actual replacement : replacing one of the file that is part of a logical model without touching the others corrupts the whole model. Note that all "Replace With" actions suffer from this second issue, not only the "Replace With > Local History..." one.
Laurent, at the least the actual replacement should be handled by http://egit.eclipse.org/r/#change,3813 - but the comparison still doesn't consider the logical mode, that's right.
Benjamin, I confess haven't tested the actual replacement before raising this bug, I'll do it now and confirm whether this part is actually fixed with your changes :).
Benjamin, Just tested this with the latest code from the github egit repository ... and got the following exception when using Replace With > Git Index and actually clicking "finish". I'll switch to the eclipse repo instead of git to see whether that changes anything. java.lang.NullPointerException at org.eclipse.egit.core.synchronize.GitResourceVariantTreeSubscriber.refresh(GitResourceVariantTreeSubscriber.java:141) at org.eclipse.team.core.subscribers.SubscriberResourceMappingContext.refresh(SubscriberResourceMappingContext.java:167) at org.eclipse.team.core.subscribers.SubscriberResourceMappingContext.ensureRefreshed(SubscriberResourceMappingContext.java:207) at org.eclipse.team.core.subscribers.SubscriberResourceMappingContext.fetchRemoteContents(SubscriberResourceMappingContext.java:96) at org.eclipse.emf.compare.logical.model.EMFResourceMapping.getTraversals(EMFResourceMapping.java:158) at org.eclipse.team.core.mapping.provider.SynchronizationScopeManager.addMappingsToScope(SynchronizationScopeManager.java:389) at org.eclipse.team.core.mapping.provider.SynchronizationScopeManager.internalPrepareContext(SynchronizationScopeManager.java:200) at org.eclipse.team.core.mapping.provider.SynchronizationScopeManager.access$0(SynchronizationScopeManager.java:187) at org.eclipse.team.core.mapping.provider.SynchronizationScopeManager$1.run(SynchronizationScopeManager.java:167) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.team.core.mapping.provider.SynchronizationScopeManager.initialize(SynchronizationScopeManager.java:165) at org.eclipse.team.core.subscribers.SubscriberScopeManager.access$0(SubscriberScopeManager.java:1) at org.eclipse.team.core.subscribers.SubscriberScopeManager$1.run(SubscriberScopeManager.java:81) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.team.core.subscribers.SubscriberScopeManager.initialize(SubscriberScopeManager.java:79) at org.eclipse.team.ui.synchronize.ModelOperation.initializeScope(ModelOperation.java:161) at org.eclipse.team.ui.synchronize.ModelOperation.beginOperation(ModelOperation.java:124) at org.eclipse.team.ui.synchronize.ModelOperation.run(ModelOperation.java:105) at org.eclipse.egit.ui.internal.operations.GitScopeUtil.collectRelatedChanges(GitScopeUtil.java:168) at org.eclipse.egit.ui.internal.operations.GitScopeUtil.access$0(GitScopeUtil.java:158) at org.eclipse.egit.ui.internal.operations.GitScopeUtil$1.run(GitScopeUtil.java:141) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
The same exception is thrown with the latest code from the eclipse egit repository (master branch).
This is a regression introduced by another change not related to logical models and affects many other egit operations (see task 358621). A fix is currenlty in review.
Laurent, can you give this another try with todays EGit master? The NPE was resolved in the meantime
Benjamin, Sorry for the time it took for me to react, I have been kept quite busy with another project. I could test extensively the different actions that should be calling the model providers, and only found two in EGit that were still comparing without this support. I'll raise the corresponding bugs momentarily. This particular bug has been fixed and can be closed, thanks!
For the record, there are two actions still not considering the model providers : - Replace With > Local History... - Replace With > Previous From Local History. However, these are "team" actions, that should be fixed through bug 354931.
Great. Let's close this.