It's all about the answers!

Ask a question

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

Jazzuser user (4833) | asked Nov 24 '17, 5:52 a.m.

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;

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.

Geoffrey Clemm commented Nov 24 '17, 8:54 a.m.

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?

Jazzuser user commented Nov 26 '17, 11:19 p.m.

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.

Geoffrey Clemm commented Nov 27 '17, 5:57 a.m.

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.

Jazzuser user commented Nov 27 '17, 6:39 a.m.

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 :

Geoffrey Clemm commented Nov 27 '17, 8:05 a.m.

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 to post your answer.