handle to a snapshot
Hi,
Using
I am able to get a handle to a workspace or stream based on a name. Does something similar exist for snapshots or do I need to get the snapshots based on the found the workspace/stream and then compare its name to a searchstring?
Regards,
Bernd.
Using
IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(repo);
IWorkspaceSearchCriteria crit1 = IWorkspaceSearchCriteria.FACTORY.newInstance();
crit1.setPartialNameIgnoreCase("PRO");
crit1.setKind(IWorkspaceSearchCriteria.ALL);
try {
List<IWorkspaceHandle> handles = wm.findWorkspaces(crit1, Integer.MAX_VALUE, null);
}
catch (TeamRepositoryException e) { e.printStackTrace(); }
I am able to get a handle to a workspace or stream based on a name. Does something similar exist for snapshots or do I need to get the snapshots based on the found the workspace/stream and then compare its name to a searchstring?
Regards,
Bernd.
2 answers
Snapshots are represented as IBaselineSet.
IBaselineSetSearchCriteria criteria = IBaselineSetSearchCriteria.FACTORY.newInstance();
criteria.setExactName("MySnapshot");
List<IBaselineSetHandle> snapshots = wm.findBaselineSets(criteria, Integer.MAX_VALUE, null);
IBaselineSetSearchCriteria criteria = IBaselineSetSearchCriteria.FACTORY.newInstance();
criteria.setExactName("MySnapshot");
List<IBaselineSetHandle> snapshots = wm.findBaselineSets(criteria, Integer.MAX_VALUE, null);
Hi,
Using
IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(repo);
IWorkspaceSearchCriteria crit1 = IWorkspaceSearchCriteria.FACTORY.newInstance();
crit1.setPartialNameIgnoreCase("PRO");
crit1.setKind(IWorkspaceSearchCriteria.ALL);
try {
List<IWorkspaceHandle> handles = wm.findWorkspaces(crit1, Integer.MAX_VALUE, null);
}
catch (TeamRepositoryException e) { e.printStackTrace(); }
I am able to get a handle to a workspace or stream based on a name. Does something similar exist for snapshots or do I need to get the snapshots based on the found the workspace/stream and then compare its name to a searchstring?
Regards,
Bernd.