How do I obtain working copy information? [message #8944] |
Thu, 13 September 2007 08:27  |
Eclipse User |
|
|
|
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 07:44  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.07321 seconds