|Re: retrieving the exact revision number of the "SVNRevision#BASE" revision [message #42160 is a reply to message #41905]
||Thu, 26 February 2009 10:14
| Igor Burilo
Registered: July 2009
Hello laurent Goubet,|
1. As I correctly understand you created your own view which shows EMF
objects in it. And you want to compare your EMF objects (using Subversive
API) in the similar way like Subversive already does in Package Explorer:
Compare with Base from Working Copy, Compare with Revision Url. And as you
have more complex relations between your objects you need also to fetch
extra info while comparing. Do you?
2. As I understand from your description you compare object(file) from
working copy with other remote object and you need to get base revision of
your local file(this is a "Last Changed Rev" when you call 'svn info'
command for file). If it is, then you can fetch it in the following way:
ResourceElement left = ...;
ILocalResource local = left.getLocalResource();
long baseRev = local.getBaseRevision();
long rev = local.getRevision();
As a reference you can see ThreeWayResourceCompareInput file which gathers
resources in the similar way, see fillMenu method which creates an action of
our interest, I attached it.
Also you wrote that currently compare file is right, but it seems that it
should be left.
> I am a dev of EMF Compare (Model comparison within Eclipse). As such we
> have defined our own comparison engine and views so as to allow users to
> compare this kind of files. Models can have references to other models
> which we need to load in order to detect differences on such links.
> What we are fed is a "CompareEditorInput" referencing a "left", "right"
> and "ancestor"
> org.eclipse.team.svn.ui.compare.ResourceCompareInput.Resourc eElement.
> From these elements I have been able to retrieve the revision of the
> currently compared file (right) in the form of an IRepositoryResource
> and from there, use the IRepositoryResource#getInfo() to have the
> timestamp of this file. Alongside this, I could get all SVNLogEntry
> regarding the linked file and compare the timestamps to know which of
> these revisions I should load to resolve the reference.
> The problem is : for the "ancestor" part of the input, I have no
> "Information" (IRepositoryResource#getInfo() returns null). The
> IRepositoryResource#getSelectedRevision() of my ancestor is
> "SVNRevision#BASE" and I think the problem lies in there. Whatever the
> source, I couldn't find a way to link this "base" revision to an actual
> revision number or a timestamp. I need this information to be able to
> retrieve the linked file's revision that existed at the time this base
> one has been committed. Is there any API or utility (SVNUtility,
> ISVNConnector, ...) that could allow me to fetch such information?
> Not sure I am clear with this explanation as I am pretty far in the
> framework :p. Feel free to ask if any information is missing.
> Laurent Goubet
Powered by FUDForum
. Page generated in 0.02179 seconds