retrieving local history of an IFile [message #334534] |
Mon, 16 February 2009 11:51  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------060206060303020808050007
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
hi,
I have found a way to retrieve the history of a given IFile when its
project is connected to a VCS repository through code as :
<snip>
final IProject project = file.getProject();
final RepositoryProvider provider = RepositoryProvider.getProvider(project);
final IFileHistoryProvider historyProvider =
provider.getFileHistoryProvider();
final IFileHistory history = historyProvider.getFileHistoryFor(target,
IFileHistoryProvider.NONE, new NullProgressMonitor());
</snip>
Though try as I might, I cannot find any API way of retrieving the same
information when the project is _not_ connected to a repository. All I
found was something like
<snip>
final FileSystemManager fsm =
((org.eclipse.core.internal.resources.Workspace)workspace).g etFileSystemManager();
final HistoryStore = fsm.getStates(file.getFullPath(), new
NullProgressMonitor());
</snip>
Which leads to a fair amount of discouraged access warnings. Isn't there
any open API I'd have missed while digging through the code?
Thanks
Laurent Goubet
Obeo
--------------060206060303020808050007
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
--------------060206060303020808050007--
|
|
|
|
Re: retrieving local history of an IFile [message #334773 is a reply to message #334535] |
Thu, 26 February 2009 13:35  |
Eclipse User |
|
|
|
Hi Laurent,
I am trying to retrieve the latest file in the local history. Did you get
it to work without accessing the internal API so that you do not get the
discourage access warnings?
I have something like:
FileSystemResourceManager fsm =
((org.eclipse.core.internal.resources.Workspace)PlusUIPlugin .getWorkspace()).getFileSystemManager();
IFileState[] fileStates =
fsm.getHistoryStore().getStates(myFile.getFullPath(),null);
InputStream is = fileStates[0].getContents(); //these are the contents I
want of the last file.
Thanks,
Zeus
|
|
|
Powered by
FUDForum. Page generated in 0.10478 seconds