Get snapshot information; I've got change-set information
I've got a change-set's details (IChangeSet/UUID). Now, I want to emulate the "Open in Change-Explorer" action in my eclipse application.
Tried searching for samples...could locate ShowChangeSetsAction class in the plugin - com.ibm.team.filesystem.ide.ui
This is the API that the plugin uses to open the change-explorer:
@Override
protected void open(IWorkbenchPage page, SnapshotId snapshot, List<IChangeSetHandle> changeSets) {
ChangesViewConverter.openChangeExplorer(page, new ChangeSetInput(snapshot, changeSets));
}
I've got changeSets, but how do I find the snapshot ?
Any alternate way to open the change-set, without providing snapshot ?
Tried searching for samples...could locate ShowChangeSetsAction class in the plugin - com.ibm.team.filesystem.ide.ui
This is the API that the plugin uses to open the change-explorer:
@Override
protected void open(IWorkbenchPage page, SnapshotId snapshot, List<IChangeSetHandle> changeSets) {
ChangesViewConverter.openChangeExplorer(page, new ChangeSetInput(snapshot, changeSets));
}
I've got changeSets, but how do I find the snapshot ?
Any alternate way to open the change-set, without providing snapshot ?
Accepted answer
You can create an empty SnapshotId: snapshot = SnapshotId.createEmptyId(repo);
That will allow you to open just the change sets with no reference to a snapshot, workspace, or stream. That means no paths will be resolved for any items in the change set. Also, you are referencing internals and they may change without warning. Use at your own risk.
That will allow you to open just the change sets with no reference to a snapshot, workspace, or stream. That means no paths will be resolved for any items in the change set. Also, you are referencing internals and they may change without warning. Use at your own risk.
Comments
One other answer
Could fix this.
Following is the code that opens change-set explorer, given its changeset UUID:
IChangeSetHandle changeSetHandle = (IChangeSetHandle) IChangeSet.ITEM_TYPE.createItemHandle(UUID.valueOf("_Zpj9EOo3EeOlUpxIHF-S3w"), null);
IChangeSet cs = (IChangeSet) repository.itemManager().fetchCompleteItem(changeSetHandle, IItemManager.DEFAULT, monitor);
List<IChangeSet> changeSets = new ArrayList<IChangeSet>();
changeSets.add(cs);
ChangesViewConverter.openChangeExplorer(getSite().getPage(), new ChangeSetInput(changeSets));
Following is the code that opens change-set explorer, given its changeset UUID:
IChangeSetHandle changeSetHandle = (IChangeSetHandle) IChangeSet.ITEM_TYPE.createItemHandle(UUID.valueOf("_Zpj9EOo3EeOlUpxIHF-S3w"), null);
IChangeSet cs = (IChangeSet) repository.itemManager().fetchCompleteItem(changeSetHandle, IItemManager.DEFAULT, monitor);
List<IChangeSet> changeSets = new ArrayList<IChangeSet>();
changeSets.add(cs);
ChangesViewConverter.openChangeExplorer(getSite().getPage(), new ChangeSetInput(changeSets));