Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Subversive » How do I obtain working copy information?
How do I obtain working copy information? [message #8944] Thu, 13 September 2007 12:27 Go to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi,
Buckminster needs to find some working copy information. Looking at the
ISVNClientWrapper I only find the info2() method that extracts
information from the server. Not the info() method that extracts working
copy information.

So how do I do that? I'd like to for instance obtain the last changed
version from my working copy. Using Subclipse I'd do something like:

clientAdapter.getInfoFromWorkingCopy(workingCopy).getLastCha ngedRevision().getNumber()

where workingCopy is a java.io.File.

TIA,
Thomas Hallgren
Re: How do I obtain working copy information? [message #8965 is a reply to message #8944] Fri, 14 September 2007 11:43 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
I used the RTFC approach and found the answer:

Info2 info = SVNUtility.getSVNInfo(workingCopy);
if(info != null)
return info.lastChangedRevision;

- thomas

Thomas Hallgren wrote:
> Hi,
> Buckminster needs to find some working copy information. Looking at the
> ISVNClientWrapper I only find the info2() method that extracts
> information from the server. Not the info() method that extracts working
> copy information.
>
> So how do I do that? I'd like to for instance obtain the last changed
> version from my working copy. Using Subclipse I'd do something like:
>
> clientAdapter.getInfoFromWorkingCopy(workingCopy).getLastCha ngedRevision().getNumber()
>
>
> where workingCopy is a java.io.File.
>
> TIA,
> Thomas Hallgren
Re: How do I obtain working copy information? [message #9871 is a reply to message #8965] Tue, 30 October 2007 11:44 Go to previous message
Eclipse UserFriend
Originally posted by: alexander.gurov.polarion.org

Hi Thomas,

Sorry for too late reply, the SVNClientInterface declares that info2
method allows to retrieve working copy information if path on file system
is specified as the input argument. So, the
SVNUtility.getSVNInfo(workingCopy) method works using
ISVNClientWrapper.info2(). Unfortunately the
SVNUtility.getSVNInfo(workingCopy) method has well known restrictions:
1) any exception will be catched by this method and silently converted to
"null-value" result
2) it returns only Revision.BASE information
If you want to handle possible errors in different way or retrieve
Revision.WORKING information you could use the following code:

ISVNClientWrapper proxy =
CoreExtensionsManager.instance().getSVNClientWrapperFactory( ).newInstance();
try {
Info2 []st = proxy.info2(root.getAbsolutePath(), Revision.WORKING, null,
false, new SVNNullProgressMonitor());
}
finally {
proxy.dispose();
}

Another way is to implement your own operation and then perform it using
ProgressMonitorUtility class methods. This way will provide you with
ability to flexibly define error handling strategies and perform tasks in
background thread.


Thomas Hallgren wrote:

> I used the RTFC approach and found the answer:

> Info2 info = SVNUtility.getSVNInfo(workingCopy);
> if(info != null)
> return info.lastChangedRevision;

> - thomas

> Thomas Hallgren wrote:
>> Hi,
>> Buckminster needs to find some working copy information. Looking at the
>> ISVNClientWrapper I only find the info2() method that extracts
>> information from the server. Not the info() method that extracts working
>> copy information.
>>
>> So how do I do that? I'd like to for instance obtain the last changed
>> version from my working copy. Using Subclipse I'd do something like:
>>
>>
clientAdapter.getInfoFromWorkingCopy(workingCopy).getLastCha ngedRevision().getNumber()
>>
>>
>> where workingCopy is a java.io.File.
>>
>> TIA,
>> Thomas Hallgren
Previous Topic:How to retrieve log infos.
Next Topic:CPU hogging
Goto Forum:
  


Current Time: Tue Apr 16 13:46:00 GMT 2024

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

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

Back to the top