How do you create a snapshot using the java api?
|
8 answers
![]()
Try:
|
![]()
compile error:
incompatible types found : com.ibm.team.scm.common.IBaselineSetHandle required: com.ibm.team.scm.common.IBaselineSet IBaselineSet snapshot = stream.createBaselineSet(null, "snapshot name", "snapshot comment", true, MONITOR); my code snippit: // Create Stream IWorkspaceConnection stream = wm.createStream(processarea, streamName, msg, MONITOR); // Add new components stream.addComponent(component,baseConnection,false,MONITOR); // Create snapshot IBaselineSet snapshot = stream.createBaselineSet(null, "snapshot name", "snapshot comment", true, MONITOR); |
![]()
change to
IBaselineSetHandle snapshot = stream.createBaselineSet(null, "snapshot name", "snapshot comment", true, MONITOR); compiles but blows up: Exception in thread "main" java.lang.NullPointerException at com.ibm.team.scm.client.internal.WorkspaceConnection.createBaselineSet(WorkspaceConnection.java:3264) at branch.Repository.createStream(Repository.java:464) at branch.CmdRequest.processRequest(CmdRequest.java:66) at branch.CmdRequest.main(CmdRequest.java:26) |
![]()
My mistake -- createBaselineSet returns a handle, not an item.
The NPE is due to the null first argument (though the spec says this is allowed). Try passing Collections.emptyList() instead. I've opened 112903: IWorkspaceConnection.createBaselineSet fails with null excludedComponents. |
![]()
excludedComponents can not be null.
IBaselineSetHandle snapshot = stream.createBaselineSet(excludedComponents, "snapshot name", "snapshot comment", false, MONITOR); |
![]()
Yes. Does it work if you pass Collections.emptyList() instead?
|
![]()
For future use: It does work with Collections.emptyList()
|
![]()
Now it´s deprecated. How do I use the new one?
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.