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

List all changesets in component in stream

 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

0 votes



2 answers

Permanent link
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
}

0 votes

Comments

Hi Luca, 

Thanks for your answer!

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

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

 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

0 votes

Comments

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

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

See also News and Noteworthy of RTC 6.0.3

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?

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

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 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

Question asked: Dec 05 '17, 6:04 a.m.

Question was seen: 3,310 times

Last updated: Dec 13 '17, 7:55 a.m.

Confirmation Cancel Confirm