Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 265011

Summary: retrieving FileRevision of compared elements.
Product: [Eclipse Project] Platform Reporter: Laurent Goubet <laurent.goubet>
Component: TeamAssignee: Platform Team Inbox <platform-team-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: cedric.brun
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Laurent Goubet CLA 2009-02-16 08:40:36 EST
Hi,

I really didn't know where in the newsgroup I could have put this, figured a bugzilla entry would do :). I am a commiter on EMF Compare (aims at providing comparison capabilities for eclipse and inherits behavior from the compare framework). Problem is : EMF models can have links towards other EMF models and as such, comparing a given revision of a given model requires the comparison of all linked models. For this reason, I'd need to know the file revision currently being compare to and even though I found a way, this yields DiscouragedAccess warnings.

Specifically, when using the right-click -> compare with -> history (or compare with -> latest from HEAD for that matters) and selecting an history element, org.eclipse.compare is fed with a "org.eclipse.team.internal.ui.history.FileRevisionTypedElement" wrapped around the specific IFileRevision the workspace file is being compared to.

For now, I use a code such as this :

<snip>
if (((ICompareInput)input).getRight() instanceof FileRevisionTypedElement) {
  IFileRevision rightRevision = ((FileRevisionTypedElement)right).getFileRevision();
</snip>

Accessing the FileRevisionTypedElement is the one and only discouraged access I have been forced to in order to retrive the IFileRevision. Is there any other way to get either the currently selected element in the "History" view or the actual file revision we're being compared to? A way to unwrap this IFileRevision in other words. If not, is there any chance FileRevisionTypedElement could be opened as API or a public interface added to access the wrapped revision?
Comment 1 Eclipse Webmaster CLA 2019-09-06 15:35:51 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 2 Eclipse Genie CLA 2021-11-03 13:44:21 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.