It's all about the answers!

Ask a question

How to compare workspaces and get the outgoing changeset content?

Lan Xia (111) | asked Jan 29 '15, 9:12 a.m.
retagged Feb 06 '15, 2:20 p.m. by Dejan Custic (2855)

I need to compare workspaces and get the outgoing changeset content/patch, so that we can analyze the changeset content later. I am able to accomplish this by using scm commands.

-> compare workspaces to list change sets:
scm --non-interactive --config <configure> compare -I fwbs  -f o workspace <ws1> workspace <ws2> -r <repo>

-> parse above output and check each change set to get the content:
scm --non-interactive --config <configure> diff changeset <id> --workspace <ws1> -r <repo>

The only issue that I have with above cmd is the performance. Each cmd takes about 20 secs to execute. Therefore, if a user has n changesets, that is, 20 * (n+1) secs, which is too slow for my web application. Is there a better way of doing it? Other scm cmd? Will RTC API help in this case? Thanks.


One answer

permanent link
Lily Wang (4.9k714) | answered Jan 29 '15, 8:00 p.m.
Hi Lan,
Have you tried "lscm" command?
Please refer to
"For improved performance, you can run the command line using lscm.bat or lscm. This lightweight command line version creates a daemon process on your machine that reduces the startup time and improves the execution time for most commands. "

Lan Xia commented Jan 30 '15, 9:25 a.m.

Thanks for your suggestion, Lily. I tried lscm. It takes about the same time as scm.

I also tried RTC Java APIs, I am able to compare workspaces and list changeset content. (It takes 2 mins in total. I have about 18 changesets in my test.) Now the problem is that I can only get the file content after the change, but how can I get the patch? I would like to get the same output as diff cmd so I can tell which line is changed. Any suggestions? Thanks. 

Lily Wang commented Feb 02 '15, 2:10 a.m.

I'm not familiar with API. I suggest you submit a new discussion for the API usage.

Ralph Schoon commented Feb 02 '15, 3:01 a.m.

lscm should be faster after the initial login, as the server has to start the TeamPlatform only once.

There are few examples for SCM API here:
You also want to look at

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.