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

create a stream from the snap shot of another stream

using the java api how do you create a stream from the snap shot of another stream

0 votes



4 answers

Permanent link
I suggest having a look at the source for:
com.ibm.team.filesystem.ui.changes.actions.ReplaceWithSnapshotAction

It does the following (showing only the relevant bits, and slightly refactored):

IBaselineSet snapshot = ... // snapshot you're starting with

// fetch the baselines in the snapshot
List<IBaselineHandle> baselineHandles = snapshot.getBaselines();
List<IBaseline> baselines = snapshot.getRepository().itemManager().fetchCompleteItems(baselineHandles, IItemManager.DEFAULT, progress.newChild(5));

// create replace operations for each baseline
List<IComponentOp> ops = new ArrayList<IComponentOp>(missingComponentsInSource.size());
for (IBaseline baseline : baselines) {
IBaselineConnection baselineConnection = workspaceManager.getBaselineConnection(baseline, loopProgress.newChild(1));
IComponentHandle component = baseline.getComponent();
ops.add(workspaceConnection.componentOpFactory().addComponent(component, baselineConnection, true));
}

// apply the operations atomically
IUpdateReport report = workspaceConnection.applyComponentOperations(ops, progress.newChild(5));

0 votes


Permanent link
Note that development questions like this would be better posted in the 'Extending Team Concert' forum.

0 votes


Permanent link
so all java api questions have to be posted in that forum.

0 votes


Permanent link
Just a suggestion. The 'Using Team Concert' forum is directed at users. The 'Extending Team Concert' one is targeted at developers looking to extend Jazz or otherwise drive it via APIs.

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

Question asked: Apr 23 '10, 2:01 p.m.

Question was seen: 8,394 times

Last updated: Apr 15 '13, 6:22 a.m.

Confirmation Cancel Confirm