It's all about the answers!

Ask a question

Any available script to extract history (ordered by associated work items or file) for files from only some scm directories of the RTC component?

michele rosso (122) | asked Jun 25 '12, 6:58 a.m.
edited Jul 09 '12, 2:56 p.m. by Geoffrey Clemm (29.3k23035)
In our context, we have a large RTC component defined but with many "sub-components" driven in for our project (which is already a part of a greater project with several RTC components). We need to be able to easily extract the history of changes at one sub-component level (meaning a directory into scm and sometimes a sub-directory of this sub-component directory), to provide what work-items were included for this part, with the associated changes done for each file in the sub-directory.

I saw the RTC WorkItem 66832 about "Allow viewing of subset of component history based on directory/subdirectories" and added my vote for but by meantime this RTC WorkItem can progress I am wondering if someone would have some running work-around way (script) in place doing some such history extract and who would be ok to share it ?
On my side:
- I tried to use scm history -v command line but I could not find options that would directly provide the ordered lists I am needing for our sub-component status:
1) list of work-items applied to the files in this scm directory,
2) for each file in the scm directory: the list of changeset (with attribute a-c-d) done for each Work Item applied to the file).

- I am also wondering if using workspace specifically created for could help to get this more easily...?  But how to create a workspace that would get only some scm subdirectories files in with their stream history kept ? (I have to say I tried without success ... :-(  ) . Maybe then working on a such workspace could able to easily get the history extract we are looking for...?

Thank for any help!

Evan Hughes commented Jun 25 '12, 11:27 a.m.

If it feels like you have a logical grouping of items within an RTC component, it may be worth splitting it out into a formal component. Then you can use our tooling as it was designed, rather than trying to bend it to your will.

Accepted answer

permanent link
Evan Hughes (2.4k1018) | answered Jun 25 '12, 11:28 a.m.
You could try using the 'lscm compare' to generate a change log, ordered by file then prune the paths you don't care about with sed/awk/perl.
Ralph Schoon selected this answer as the correct answer

michele rosso commented Jun 27 '12, 3:17 a.m.

Thanks Evan for your answer, yes "lscm compare" should be a better alternate to the "scm history" one which need to be run for each file. I tried its equivalent by the "compare" view we have into the RTC Eclipse Client and the output I could download and transform a few using upload of unformatted text into worsheet tool is already a very good base for my need. I will try using the command line also as soon as I will have found the right parameters to set in input (to compare stream to a workspace I set as previous reference) so that it works. Thank a lot!

Evan Hughes commented Jun 27 '12, 9:23 a.m.

I'm glad that will help you out. Could you mark this answer as "accepted" if it fills your need?

Your answer

Register or to post your answer.