How to programmatically(Plain Java) create repository workspace for the specified changeset?
I want to create a repository workspace programmatically in order to get the file of the specified changeset.
So, How I get the new workspace's IWorkspaceConnection?
I use the follow code,could create workspace.
But the baseline of workspace's component is initial baseline, so the content is empty.
String StrChangeSetUUID = "_r7455343xMsxIDwg";
IChangeSetHandle csHandle = (IChangeSetHandle) IChangeSet.ITEM_TYPE.createItemHandle(uuid, null);
IChangeSet changeSet = (IChangeSet) repo.itemManager().fetchCompleteItem(csHandle, IItemManager.DEFAULT, null);
IComponentHandle componentHandle = changeSet.getComponent();
IWorkspaceConnection workspaceConnection = null;
try
{
// How to programmatically create repository workspace for the specified changeset?
workspaceConnection = wm.createWorkspace(repo.loggedInContributor(), "Automatic created WM", "Description", monitor);
workspaceConnection.addComponent(componentHandle, false, monitor);
}
catch (TeamRepositoryException e)
{
e.printStackTrace();
}
|
Be the first one to answer this question!
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.