Replace components with active change-sets
SEC Servizi (971●2●38●60)
| asked Mar 28 '13, 4:43 a.m.
edited Aug 02 '16, 9:10 a.m. by David Lafreniere (4.8k●7)
We are trying to programmatically create a new repository workspace even with components having active change-sets.
We use a stream as base seed workspace and a repository workspace to obtain the updated components (with active change-sets).
Our first code was:
IWorkspace newWks = scmService.createWorkspace(user, newWksName, newWksDescription, stream, null, stream, null, null, null).getWorkspace(); IComponentHandle[] components = scmService.getComponentsForWorkspace(stream, null);
but it throws an exception:
com.ibm.team.repository.common.TeamRepositoryException: Source change history era must not have active change sets
So, instead of replace components, we change our code to use drop & add components:
IComponentOpDescriptor[] dropOps = new IComponentOpDescriptor[n]; IComponentOpDescriptor[] addOps = new IComponentOpDescriptor[n];
It seems odd, but now it works... :)
We cannot use only one array of ops because an exeception is throwned:
com.ibm.team.repository.common.TeamRepositoryException: Cannot have 2 operations on 1 component
In the new repository workspace, the active change-sets appear to belong to ADMIN instead of the original owner... Any advice?
Thanks in advance.
|
Accepted answer
Those change sets are cloned because they cannot reference the same change sets from the seed workspace (active change sets can only exist in one workspace). The logged-in user will be the owner of the change sets.
David Lafreniere 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.
Comments
Could you provide more information around this use case? Why are components being replaced from the workspace once created? Why are the change sets active?