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
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
One answer
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
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
Comments
Geoffrey Clemm
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Mar 08 '15, 5:13 p.m.Just for interest's sake, why would you want to do this?
Nayeem M
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..