It's all about the answers!

Ask a question

Getting history for all the files in Repository


Nayeem M (3115) | asked Mar 07 '15, 9:29 a.m.
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


Comments
Geoffrey Clemm commented Mar 08 '15, 5:13 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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


Nayeem M commented Mar 09 '15, 5:23 p.m.

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
Evan Hughes (2.4k1018) | answered Mar 09 '15, 3:01 p.m.
JAZZ DEVELOPER
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. 

Comments
Nayeem M commented Mar 09 '15, 5:24 p.m. | edited Mar 09 '15, 5:31 p.m.

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


Evan Hughes commented Mar 09 '15, 5:33 p.m.
JAZZ DEVELOPER

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. 


Nayeem M commented Mar 12 '15, 12:50 p.m.

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

Your answer


Register or to post your answer.