How to get IVersionable 'history'
Accepted answer
ScmService->getHistoryForVersionable(ServiceHistoryProvider historyProvider, IVersionableHandle versionableHandle, int limit, boolean examineEras, ISynchronizationTimes[] syncTimes,IRepositoryProgressMonitorHandle monitor)
Comments
Thank you so much Surya
Boaz
Sure.
Files belong to components. And, in order to get history of a file in component, you will need to provide a context - workspace or stream. A component can be included in more than one stream and these stream can have different set of changesets. Streams are a way to isolate changes of one team from another. When teams modify a file in a component, they are always modifying it in a context - in a workspace or in a stream. I dont think there is such a thing as 'show history in repository'.
Well, yes, the Eclipse client has this feature 'show all in repository'.
I guess, you could query for all changesets in a component and get history in repository.
You can call ScmQueryService.findChangeSets() and set context for workspace as null to widen the scope to repository.
IVersionableHandle file;
IWorkspaceManager manager = SCMPlatform.getWorkspaceManager(repo);
IChangeSetSearchCriteria criteria = IChangeSetSearchCriteria.FACTORY.newInstance();
criteria.setComponent(testComponent);
criteria.setOldestFirst(true);
//criteria.setContext(testWorkspace.getContextHandle());
if (file != null) {
criteria.setItem(file);
}
List<IChangeSetHandle> changesets = manager.findChangeSets(criteria, IWorkspaceManager.MAX_QUERY_SIZE, monitor);