Deliver by using plainJava API
The code as follow, I've check in, but an exception throw when program call the last line code:
com.ibm.team.scm.common.ChangeSetsNotOutgoingException: These change sets are not outgoing and therefore cannot be delivered.
at com.ibm.team.scm.client.internal.WorkspaceConnection.checkAgainstReport(WorkspaceConnection.java:2120)
at com.ibm.team.scm.client.internal.WorkspaceConnection.runDeliver(WorkspaceConnection.java:2012)
My Code:
IChangeSet changeSetToDeliver = null;
List<IChangeSetHandle> activeChangeSets = workspaceConnection.activeChangeSets(comp);
System.out.println("Active ChangeSets: " + activeChangeSets.size());
for (IChangeSetHandle changeSetHandle : activeChangeSets) {
if (changeSetHandle instanceof IChangeSet) {
changeSetToDeliver = (IChangeSet) changeSetHandle;
}
}
IChangeSetHandle ics = workspaceConnection.getCurrentChangeSet(comp);
System.out.println("IChangeSetHandle:" + ics);//Here output is 0
// deliver the code
IChangeHistorySyncReport sync = workspaceConnection.compareTo(workspaceConnection, WorkspaceComparisonFlags.CHANGE_SET_COMPARISON_ONLY, Collections.EMPTY_LIST, null);//The 3rd parameter could be used to exclude components on the workspace from the compare operation
List list = sync.outgoingChangeSets(comp);
System.out.println("Out going change sets size:" + list.size()); //Here output is 0
workspaceConnection.deliver(workspaceConnection, sync, workspaceConnection.getBaselineSets(null), Arrays.asList(new IChangeSet[]{changeSetToDeliver}), null);
Is there any one can help for this issue? how should I make the change set to out going chengeset ?
And I know the last line code should be:
workspaceConnection.deliver(workspaceConnection, sync, workspaceConnection.getBaselineSets(null), sync.outgoingChangeSets(comp), null);
But as you can see the out going size is 0 ,but the change set above I get it, which is not 0.
2 answers
You are comparing the workspace to itself (see workspaceConnection.compareTo(workspaceConnection, ...) then telling the workspace to deliver the change sets to itself (see workspaceConnection.deliver(workspaceConnection, ...).
You may be able to accomplish what you want by using the command line interface. It would allow you to avoid these mechanical/syntactic problems and concentrate on flowing your changes.
You may be able to accomplish what you want by using the command line interface. It would allow you to avoid these mechanical/syntactic problems and concentrate on flowing your changes.