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

Accepting baseline update using java api

How do you accept a baseline update using the java api?

I have a stream which flows to a workspace....

I create a snapshot in the stream.........

If I use the GUI I see that there is a baseline updtae to be accepted
in the workspace.

How do I accept it using the java api?

1

0 votes



5 answers

Permanent link
How do you accept a baseline update using the java api?

I have a stream which flows to a workspace....


IWorkspaceConnection.accept() accepts a list of baselines as an argument. Choose the 1 baseline per component that you want to accept, put it in a list, and pass it in.

From my experiments, you can have multiple incoming baselines for the same component, but you can only accept them one at a time.

See also: http://jazz.net/forums/viewtopic.php?t=12242

0 votes


Permanent link
List changes = workspace.activeChangeSets(component);

changes size equals zero

workspace.accept(AcceptFlags.DEFAULT,changes, null, MONITOR);

0 votes


Permanent link
IChangeHistorySyncReport sync = workspace.compareTo
(stream,WorkspaceComparisonFlags.INCLUDE_BASELINE_INFO |
WorkspaceComparisonFlags.INCLUDE_EMPTY_BASELINES,
Collections.EMPTY_LIST, MONITOR);

List a = sync.incomingBaselines();
for (Iterator b = a.iterator(); b.hasNext();) {
IBaselineHandle base = (IBaselineHandle) b.next();

workspace.accept(AcceptFlags.DEFAULT,null, sync,
Collections.singletonList(base), sync.incomingChangeSets(),MONITOR);

}

0 votes


Permanent link
IChangeHistorySyncReport sync = workspace.compareTo
(stream,WorkspaceComparisonFlags.INCLUDE_BASELINE_INFO |
WorkspaceComparisonFlags.INCLUDE_EMPTY_BASELINES,
Collections.EMPTY_LIST, MONITOR);

List a = sync.incomingBaselines();
for (Iterator b = a.iterator(); b.hasNext();) {
IBaselineHandle base = (IBaselineHandle) b.next();

workspace.accept(AcceptFlags.DEFAULT,stream, sync,
Collections.singletonList(base), sync.incomingChangeSets(),MONITOR);

0 votes


Permanent link
 I had something similar but there are some problems:
1) incomingChangeSets() gives ALL the Change Sets even those pointed by baselines so you get a strange situation with accepted change set coming from accepted baselines appearing again as outgoing. You must use changeHistorySyncReport.incomingChangeSetsAfterBasis()
2) Iterating on all baselines solve the issue of accepting 1 baseline per component but in this way you keep on accepting all the change set at every iteration. So I've a cycle in which I accept 1 baseline at a time (in reverse order because I want to accept first oldest baselines) and finally I accept all change sets on top of the baselines

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
× 10,943
× 1,204
× 19

Question asked: Aug 12 '10, 1:04 p.m.

Question was seen: 9,272 times

Last updated: Jun 03 '16, 5:35 p.m.

Confirmation Cancel Confirm