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

Getting history for all the files in Repository

Is it possible to get history for all the files in a particular component of a Project area? For Ex if file PropertyReader.java has been modified by Developer A most recently.. Need to get the list like PropertyReader.java Developer A I was able to get the history using scm

 scm show history -r $URL -u $userId -P $pwd -w $ws --component icdp_core_as /source/common/Adapters/com/bac/icdp/consumer/common
/PropertyReader.java


  (2097) ----$ Developer A "Code changes for XML..." 03-Mar-2015 04:09 PM

But i need run this for each file to get the history of all the files..
So java api can simplify this task

0 votes

Comments

Just for interest's sake, why would you want to do this?

I have a requirement in my project where in if the JUnit coverage for a particular file decrease,i need get its author and send it in a report..



One answer

Permanent link
In general, calling scm show history --maximum 1 ... would provide you with the information you want, but it involves an invocation per file, which might be time consuming. 

If you're trying to generate something like a change log, then comparing against a snapshot (or baseline) would probably be more efficient to use scm compare , as that will show you all of the differences, which you can then use to prune down to the most recent change set for each modified item. 

If you want to create this list often, you could generate the history once and cache the value per file, along with the file's state id (use the --json output argument to get that kind of information). In future, when you want to regenerate the history, you could find the current state id of each file in the workspace (using  scm list remotefiles ) and only query for the history of changed files. 

0 votes

Comments

Actually have a requirement in my project where in if the JUnit coverage for a particular file decreases,i need get its author and send it in a report..I'll be generating this report once a week..SO there might be multiple builds during this time..

Then you can call 'scm show history' on the file with decreased coverage. You don't need to call it on all of the files in the repo. 


If your build runs periodically, it's possible that there are multiple change sets that modify the file, and the one that lowered coverage isn't the most recent change set. Depending where the data is going, you might be able to get away with showing the information for the last five or ten change sets, including their delivery date. 

I actually mentioned in the question that was able to get the history using scm

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
× 10,936
× 478
× 411
× 382
× 67
× 60

Question asked: Mar 07 '15, 9:29 a.m.

Question was seen: 5,368 times

Last updated: Mar 12 '15, 12:50 p.m.

Confirmation Cancel Confirm