It's all about the answers!

Ask a question

File comparison to display lines changed on 2 streams using RTC CLI

Kaushambi Singh (371310379) | asked Apr 01 '13, 10:01 a.m.
edited Apr 01 '13, 10:18 a.m.
Is there a way through RTC CLI to see number of lines changed in a file present in a component on 2 streams. Basically I want to compare the file on  streams and list the number of changed lines through RTC CLI just the way we have in RTC Eclipse client.

One answer

permanent link
Lily Wang (4.9k714) | answered Apr 02 '13, 1:06 a.m.


You can use "scm diff" command to compare the file of streams. Please see

When selecting a file, the "scm diff" can only use the version of the file on disk as the after state, so you need to create a workspace which has same version as one of the stream and load the file to a local sandbox, then use command:

scm diff file -S cp <local-path-of-the-file> stream <2nd-stream-name>



Kaushambi Singh commented Apr 03 '13, 3:54 p.m. | edited Apr 03 '13, 3:55 p.m.

Thanks Lily for your answer. The command gives the output but we also need to appendĀ  -d <local sandbox shared location> else it won't work. Actually the command gives the output but I was expecting it would only result in line different onĀ  streams but what it does is gives you the whole output with a + and - sign. But it still helps. Helps to identify where the line got changed.

Lily Wang commented Apr 05 '13, 12:34 a.m.

Yes, I agree the command can not give you a direct answer. You may need to do some scripting to get the line changed information.

Your answer

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