Access changesets (ChangeSetManager) via Mylyn [message #924231] |
Wed, 26 September 2012 16:32 |
André Meyer Messages: 4 Registered: August 2012 |
Junior Member |
|
|
hi
I want to access all the changesets of SVN, CVS, Git programatically (Java). In Eclipse/Mylyn i can do this via the „Synchronize"-view.
In the Mylyn Documentation (http://wiki.eclipse.org/Mylyn/Integrator_Reference) I read that I should use the "org.eclipse.mylyn.internal.team.ContextActiveChangeSetManager". After making some websearches for multiple hours, I managed to write the following code snippet:
Collection<AbstractActiveChangeSetProvider> providerList = FocusedTeamUiPlugin.getDefault().getActiveChangeSetProviders();
for (AbstractActiveChangeSetProvider provider : providerList) {
ActiveChangeSetManager changeSetManager = provider.getActiveChangeSetManager();
if (changeSetManager != null) {
ChangeSet[] sets = changeSetManager.getSets();
for(ChangeSet set : sets) {
//work with the changeset here
}
}
}
In the providerList I get two changeSetManager-items namely "CVSActiveCHangeSetCollector" and "SVNActiveChangeSetCollector". Unfortunately, their sets-Array (of type ChangeSet) is always empty (but there are some changes shown in the "Synchronize"-view).
What am I doing wrong? - I am not sure if "FocusedTeamUiPlugin" is the right class to use, but it was the only one I found to get the ChangeSetManagers. Because I didn't want to create a new manager (just read the content), it obviously had to be a static method.
Edit: An other thing I tried was to access the Synchronize-View via TeamUI.getSynchronizeManager(), but not the changesets.
Any hints will be appreciated very much!
Thank you very much!
[Updated on: Mon, 01 October 2012 13:35] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02884 seconds