Showing remote changes on the left [message #1746517] |
Mon, 31 October 2016 10:14  |
Eclipse User |
|
|
|
Hi,
Is it possible to configure EMF Compare to show remote changes on the left and local changes on the right?
I am extending CompareEditorInput in my application, so I have some level of control over the editor's appearance. However, I can't seem to find the place in the EMF Compare code where the assumption that remote changes should always be displayed on the right is made.
Some context: I want to do this in an application that only uses EMF Compare to resolve stash apply conflicts. In this case, the stashed local modifications appear in the right-side editor in EMF Compare, while any pulled remote changes appear in the left-side editor, which might be counter-intuitive to users.
Thanks in advance!
Vlad
|
|
|
|
Re: Showing remote changes on the left [message #1746721 is a reply to message #1746630] |
Thu, 03 November 2016 12:56   |
Eclipse User |
|
|
|
Hi Laurent,
Thank you for the suggestion. That is also what I tried, but for some reason it's not working as I would expect.
Specifically, I tried to implement my own GitResourceVariantTreeProvider by extending DirCacheResourceVariantTreeProvider. Here's what my extension looks like:
public class MyResourceVariantTreeProvider extends DirCacheResourceVariantTreeProvider {
public MyResourceVariantTreeProvider(Repository repository, boolean useWorkspace) throws IOException {
super(repository, useWorkspace);
}
@Override
public IResourceVariantTree getRemoteTree() {
return super.getSourceTree();
}
@Override
public IResourceVariantTree getSourceTree() {
return super.getRemoteTree();
}
}
However, when I replace DirCacheResourceVariantTreeProvider with my implementation, the Compare Editor always shows my conflicts as pseudo-conflicts, listing the remote changes on both the left and the right side. I am using MyResourceVariantTreeProvider to identify conflicts in CompareEditorInput.prepareInput. Do you think this is a viable approach in principle?
Cheers,
Vlad
|
|
|
|
|
Re: Showing remote changes on the left [message #1747091 is a reply to message #1747023] |
Wed, 09 November 2016 05:32  |
Eclipse User |
|
|
|
Hi Laurent,
Thank you for the support and suggestions. For now, my solution is to just show appropriate labels above the two editors (i.e. changing the label above the left side to "Remote" and the label above the right side to "Local").
I really appreciate the tip regarding this feature in Oxygen. I think my strategy will be to wait until a stable version of this feature is released next year and see if I can adapt to my use case.
Cheers,
Vlad
|
|
|
Powered by
FUDForum. Page generated in 0.05995 seconds