It's all about the answers!

Ask a question

List all changesets in component in stream


Yael K (471230) | asked Dec 05 '17, 6:04 a.m.

 Hi all,


We want to be able to list all changesets per component in stream, but scm cli only enables listing up to 1024 changesets.

The Eclipse 'show history' window enables configuring max number of enteries in "Preferences" option, even to '1000000' entries. Using this method we are able to get the full list of changesets. How can we export the Eclipse output to external file, without manually copying the output? We have to make this process as automated as possible, since it includes a lot of streams and components.

Thanks you all,
Yael

2 answers



permanent link
Luca Martinucci (1.0k397112) | answered Dec 06 '17, 5:11 a.m.
I have never tried to export the list of change sets with scm cli or Eclipse, but I have done it using RTC Plain Java API.
Have a look a this code snippet:

IWorkspaceHandle streamHandle = (IWorkspaceHandle) reportStream.getItemHandle();
IWorkspaceConnection reportStreamConn = wm.getWorkspaceConnection(streamHandle, null);       
// search change sete for each component
List<IComponentHandle> compHandles = reportStreamConn.getComponents();
for (IComponentHandle compHandle : compHandles) {
List<IChangeSetHandle> csList = new ArrayList<IChangeSetHandle>();
IChangeHistory changeHistory = reportStreamConn.changeHistory(compHandle);
while( changeHistory != null ){
IChangeHistoryDescriptor d = changeHistory.getHistoryDescriptor(true, monitor);
List<IChangeHistoryEntryChange> chList = d.recent();                
for(IChangeHistoryEntryChange ch: chList){
csList.add(ch.changeSet());
}
changeHistory = d.previousHistory();
}
// .... do what you want with csList, the list of change sets for th current component in the stream
}

Comments
Yael K commented Dec 08 '17, 2:37 p.m.

Hi Luca, 

Thanks for your answer!

Do you know if this function includes "date added" attribute of change set in stream?


Luca Martinucci commented Dec 10 '17, 8:43 a.m.

Actually, I didn't retrieve the "date added" of the change set.
Instead, I retrieved the date of each change (i.e. each changed file) in the change set.

IFileItem fileItem = (IFileItem) versionable;
// get change date
DateFormat dateFormat1 = new SimpleDateFormat("MM/dd/yyy");
DateFormat dateFormat2 = new SimpleDateFormat("HH");
Date changeDate = fileItem.getFileTimestamp();
String changeDateS = dateFormat1.format(changeDate);
String changeHourS = dateFormat2.format(changeDate);
if(changeDateS.equals("01/01/1970")){
    changeDate = cs.getLastChangeDate();
    changeDateS = dateFormat1.format(changeDate);
    changeHourS = dateFormat2.format(changeDate);
}
String changeDateSort = changeDateS.substring(6,10)+changeDateS.substring(0,2)+changeDateS.substring(3,5)+changeHourS;


permanent link
Guido Schneider (3.4k1491115) | answered Dec 11 '17, 2:21 p.m.

 LQE together with Report Builder can do this out of the box.


Just build your report and you can export it to Excel etc. or use it with RPE for official documents.

regards
Guido


Comments
Geoffrey Clemm commented Dec 11 '17, 2:27 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

My understanding is that this information is not posted to the LQE index.   Do you have some documentation or personal experience that it is?


Guido Schneider commented Dec 11 '17, 3:05 p.m.

I have V.6.0.4 and can do a report with LQE datasource based on SCM Changesets.



In traceability you can see the linked work item:


On the changeset you have some attributes like components,number of changed files etc.

Important: You need to have the TRS datasources enabled in LQE for SCM, not only CCM.

regards
Guido


Guido Schneider commented Dec 11 '17, 3:08 p.m.

See also News and Noteworthy of RTC 6.0.3


Geoffrey Clemm commented Dec 12 '17, 2:56 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Yes, some information about change sets is stored in the LQE, but the question was about listing all of the change sets in a given stream in a given component.   I didn't see any "stream" information associated with the change sets, so how would one produce a report that only listed the change sets in a given stream?


Guido Schneider commented Dec 13 '17, 4:30 a.m. | edited Dec 13 '17, 7:49 a.m.

Your right. Sorry I missed this requirement.

Also merging with the Stream Artifact does NOT give any information more (see below).
(Btw. it's silly but this gives stream information's from RM and not CCM).

Maybe we should bring Ernest or Rafik into this discussion. The use case is very valid.

regards
Guido


Geoffrey Clemm commented Dec 13 '17, 7:55 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

We definitely want to get this kind of information into the LQE index, but because of the volume for this kind of data (for example, a simple, very fast deliver operation could logically add thousands of change sets to a stream), one has to be careful how the data is modeled in the index, or be able to quickly handle massive amounts of new data.  The re-architecture of the LQE index currently underway may allow us to use the latter approach, but we'd want to verify that.

showing 5 of 6 show 1 more comments

Your answer


Register or 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.