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

SCM API : How to compare 2 snapshots with changes in the components included in each Snapshot ?

Hello Team,

I have a usecase wherein I need to get the delta changesets that are part of 2 given snapshots. I am able to get only the changesets part of components existing in both the snapshots. If there is a newly added component, and part of one of these snapshots, then am not getting the changeset as delta.

E.g :
Stream : stream1 :
Components : comp1, comp2
Snapshot 1

Then I add comp3 to the stream1 and deliver some changes and create a new snapshot : Snapshot2.

Then when i see the diff changesets between Snapshot 1 and Snapshot 2, I dont get to see this details of the newly added component.

Below is the code:

 IWorkspaceManager workspaceManager = SCMPlatform.getWorkspaceManager(teamRepository);
            IChangeHistorySyncReport changeSync = workspaceManager.compareBaselineSets(snapshot,snapshotParent,null, null);
            for (final Object currentEntry : changeSync.outgoingChangeSets()) {
              IChangeSetHandle csHandle = (IChangeSetHandle) currentEntry;
              foundCS.add(csHandle);
            }

when checked in the compareBaselineSets() API documentation, it states : Compares two baseline sets.  For components which are common, it will breakdown the change sets into incoming and outgoing.

Is there any other API, which gets the changesets of the newly added component, part of one snapshot and other as well ?

Request you to assist on this.
Thank you.

0 votes

Comments

Just for interest's sake, what do you plan on doing with the list of all change sets in the selected configuration of the newly added component?

1 vote

Hello Geoffrey,
I am interested in the all the CSs, part of two snapshots difference(delta- CSs created between Snapshot 1 and Snapshot 2).

we are developing a script, that gets the details of all the CSs in the Snapshots delta. and further processing to give some information to the users.

So with the code above, I am able to get only the CSs, if they are part of a component existing in both the Snapshot.
If there is a CS, part of newly added component(existing in only one component), then I am not getting that CS in the compareBaselineSets() API.

So is there any API, irrespective of whether the components existing in both the snapshots, gives the delta CS details ?

Request you to suggest on this.

All of the change sets that contribute to a given configuration since the component was created is unlikely to be of interest or value to your users (there could be thousands of them).   That is what you would get if you asked for all of the change sets in a newly added component in a configuration.

1 vote

Yes, that is our requirement Geoffrey. We need to get the details of all the changesets part of 2 snapshot diff.

As a part of delivery/Code release, user want to know which are the changesets going to be delivered as a release product, we do further processing to this CSs details and publish as output.

Getting the list of diff CSs, is only a small part of the logic, in the script.

Please suggest if there are any APIs to get all the diff (delta) CSs.

Also i had written, a related question : https://jazz.net/forum/questions/247265/rtc-scm-client-additiondeletion-of-components-not-shown-properly-in-the-snapshots-comparisions

I personally won't be able to help you with API questions, other than general pointers.   If you want to list every change set that went into a given configuration, then I'd suggest looking at "history" operations, and not "compare" operations.  

Also note that when you deliver a released product, and you have added a new component to that released product, I can only repeat that the list of all change sets that make up that new component, starting with the creation of that component, is extremely unlikely to be of interest/value to the users of that product. 


Be the first one to answer this question!

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,927
× 17

Question asked: Nov 24 '17, 5:52 a.m.

Question was seen: 2,218 times

Last updated: Nov 27 '17, 8:05 a.m.

Confirmation Cancel Confirm