Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Subversive » retrieving the exact revision number of the "SVNRevision#BASE" revision
retrieving the exact revision number of the "SVNRevision#BASE" revision [message #41905] Tue, 17 February 2009 17:02 Go to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1639
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080606010903040001080306
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

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
Obeo

--------------080606010903040001080306
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr/">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------080606010903040001080306--
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 Go to previous messageGo to next message
Igor Burilo is currently offline Igor BuriloFriend
Messages: 435
Registered: July 2009
Senior Member
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();
Or
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.

> Hi,
>
> 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
> Obeo
>


Re: retrieving the exact revision number of the "SVNRevision#BASE" revision [message #42367 is a reply to message #42160] Thu, 26 February 2009 13:37 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1639
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090207000806050701080208
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi Igor,

comments inlined

Igor Burilo a
Previous Topic:Software Update problems
Next Topic:SpellChecking in Commit Dialog
Goto Forum:
  


Current Time: Sun Dec 21 01:12:24 GMT 2014

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

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