removing orphan snapshots using java api
I used
IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(repo);
wm.deleteWorkspace(workspace, MONITOR);
to remove a workspace with snapshots.......now I can not rid of the snapshots
I get the following error
ERROR: CRJAZ0215I Item not found: com.ibm.team.scm.common.internal.impl.WorkspaceHandleImpl@2e8c2e8c (stateId: <unset>, itemId: , origin: <unset>, immutable: <unset>)
anybody have ideals to do this??
IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(repo);
wm.deleteWorkspace(workspace, MONITOR);
to remove a workspace with snapshots.......now I can not rid of the snapshots
I get the following error
ERROR: CRJAZ0215I Item not found: com.ibm.team.scm.common.internal.impl.WorkspaceHandleImpl@2e8c2e8c (stateId: <unset>, itemId: , origin: <unset>, immutable: <unset>)
anybody have ideals to do this??
One answer
Note: To remove the snapshots before deleting the workspace, call the following:
If you have the IWorkspaceHandle of the workspace that owns the snapshots, you can find all snapshots that have that as the owner using IBaselineSetSearchCriteria (IBaselineSetSearchCriteria has methods to scope the query further).
Ex:
IWorkspaceConnection.removeBaselineSet(IBaselineSetHandle baselineSet, IProgressMonitor monitor)
If you have the IWorkspaceHandle of the workspace that owns the snapshots, you can find all snapshots that have that as the owner using IBaselineSetSearchCriteria (IBaselineSetSearchCriteria has methods to scope the query further).
Ex:
IWorkspaceHandle wsHandle = null // GET ME SOMEHOW IWorkspaceManager workspaceManager = SCMPlatform.getWorkspaceManager(repo); IBaselineSetSearchCriteria criteria = IBaselineSetSearchCriteria.FACTORY.newInstance(); criteria.setOwnerWorkspaceOptional(wsHandle); List snapshotHandles = workspaceManager.findBaselineSets(criteria, MAX_TO_SHOW, null); // snapshotHandles contains a list of IBaselineSetHandle, so you can fetch them as normal from there...
Comments
K M
Dec 09 '13, 1:24 p.m.Does anybody know how to find orphan snapshots?