Retrieval of ChangeSets from CompareBaselineSets Method
Dear Team,
We are currently getting Changesets between 2 Snapshots by using below snippet,
IChangeHistorySyncReport changeSync = workspaceManager.compareBaselineSets(snapshot, snapshotParent,
null, null);
for (final Object currentEntry : changeSync.outgoingChangeSets()) {
IChangeSetHandle csHandle = (IChangeSetHandle) currentEntry;
System.out.println("Found CS '" +((IChangeSet) teamRepository.itemManager().fetchCompleteItem(csHandle, IItemManager.DEFAULT, null)).getComment() + "'");
matchedCSs.add(csHandle);
}
My query is ,
On What basis/order Changesets are provided from method OutgoingChangesets i.e like last modified date,created date or any other conditions.
Accepted answer
The order would be the order that the change sets appear in the history of the context (whether the context is a component in a workspace/stream or a baseline). I.e. if you were to right-click on the component/baseline and use 'Show' --> 'History', you'll always see the change sets in the same order... which is the order that the change sets were 'added' to that context (most commonly due to the 'deliver' action to a stream for example). So this is not necessarily the last modified date or creation date of a change set (although in practice more often than not this tends to be the 'last modified' date of a change set, which is really the date the change set was completed/closed - which happens during delivery to a stream - but as already mentioned, the order is not 'always' by 'last modified' date, because users can always 'resume' old change sets, or roll-back / discard/suspend change sets, etc.)