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)
 Hi,

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.

Thanks,
       Lan

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 https://jazz.net/help-dev/clm/index.jsp?re=1&topic=/com.ibm.team.scm.doc/topics/c_scm_cli.html&scope=null
"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. "

Comments
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.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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: https://rsjazz.wordpress.com/2013/09/30/delivering-change-sets-and-baselines-to-a-stream-using-the-plain-java-client-libraries/
You also want to look at https://rsjazz.wordpress.com/2013/07/15/boost-your-automation-performance-using-an-automation-server/

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.