How to get IChangeHandle
Tifa Tan (18●3●5)
| asked Nov 24 '14, 6:52 a.m.
retagged Nov 24 '14, 10:21 a.m. by Evan Hughes (2.4k●13●18) I'm trying to get the IChangeHandle object in follow two ways:
1. IChangeSetHandle csHandle = workspaceConnection.getCurrentChangeSet(comp);
2. IChangeSetHandle csHandle1 = workspaceConnection.createChangeSet(comp, null); ==>But this way thow follow Excpection:
com.ibm.team.scm.common.InvalidStreamOperationException: Change sets cannot be created on a stream
Is there any one can help ? I want to use it to deliver a local change onto stream.
lcm.refreshChanges(new ISandbox[]{sbox}, RefreshType.TRAVERSE_ALL_WITH_RECOMPUTE_OF_KNOWN, null);
//get the IChangeHandle(csHandle) object here checkInOp.requestCheckin(localChanges, csHandle, "testing comment", null);
IChangeHistorySyncReport sync = workspaceConnection.compareTo(workspaceConnection, WorkspaceComparisonFlags.CHANGE_SET_COMPARISON_ONLY, Collections.EMPTY_LIST, null);
|
Accepted answer
1. IChangeSetHandle csHandle = workspaceConnection.getCurrentChangeSet(comp);getCurrentChangeSet() returns null if there is not an active change set for the given workspace/component pair. From your later questions, it sounds like your IWorkspaceConnection may have been created on a stream. Streams can't have active change sets, so this is expected behaviour. 2. IChangeSetHandle csHandle1 = workspaceConnection.createChangeSet(comp, null);This exception is thrown when createChangeSet() is called on an IWorkspaceHandle that corresponds to a stream. Make sure that you're calling this on a workspace connection that has been created from a workspace. Be aware that the IWorkspace object can be used to refer to a workspace or a stream. The difference is revealed by calling isStream() . For most read methods you can use workspaces and streams interchangeably, but only workspaces can be committed to. Tifa Tan selected this answer as the correct answer
|
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.