Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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??

0 votes

Comments

Does anybody know how to find orphan snapshots?



One answer

Permanent link
Note: To remove the snapshots before deleting the workspace, call the following:
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...

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 1,201
× 169

Question asked: Jan 24 '11, 1:25 p.m.

Question was seen: 5,352 times

Last updated: Dec 10 '13, 11:44 a.m.

Confirmation Cancel Confirm