Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC API to compare the Outgoing items in local repository and Delivered Items

Hi,

I am using RTC Client 3.0.1.

I'm writing a eclipse plugin, where we need to find the differences between the files in Outgoing list (checked in files) and the delivered files in remote repository (stream).

What are the RTC APIs need to be used to compare the files in Outgoing list and in Delivered list? Can you provide the code snippet to capture this comparison.

Thanks

Suresh

0 votes



One answer

Permanent link
You can find some of the API with examples in http://rsjazz.wordpress.com/2013/10/15/extracting-an-archive-into-jazz-scm-using-the-plain-java-client-libraries/ and in related and referenced posts.

Please note, if you refer to local files that might have changed, you would likely have to scan the local file system and do the compare, instead of reading a zip file, to detect the unresolved changes. You can try to search the forums for more API.

0 votes

Comments

HI Ralph,

Thanks for your response. I did referred the links suggested by you.

Most of those links point to using localRepo.CompareTo(targetStream, ...) method  which returns the IChangeHistorySyncReport object. Using this we can get Outgoing change sets, etc.

But what Im looking for is code to get the Differences between the outgoing items in local repository and the corresponding items in targetStream.

Something similar to "Compare with Loca Version" menu item when we click "Team->Show History" menu.

Can you give some details on how to find the differences in the files.

Thanks

Suresh

Suresh,

as I answered already:

"Please note, if you refer to local files that might have changed, you would likely have to scan the local file system and do the compare, instead of reading a zip file, to detect the unresolved changes. You can try to search the forums for more API."

This is something that you need to code up, as far as I can tell. In my example I go through a ZIP file and compare the file in the zip and the the file in the repository workspace. I use the API that tells me there is a difference, so I can upload the new version. You would have to do something similar, go through the files on disk and compare to the repo workspace, or find the API in the RTC Eclipse Client that can do it for you. I don't know where to look. It would likely be easier to use the RTC SCM CLI.

And how I compare the files is described in the post.

Hi Ralph,

Let me rephrase the  question. What I am looking for  is suitable RTC APIs to Compare (to be specific get the Line differences) the modified files in Repository workspace (ie., outgoing list) and Stream. I have to compare these files at Server-side itself, without loading them to local machine.

The same functionality can be performed using RTC SCM CLI "diff" command as below:

diff -r <repo-url> stream <streamName> workspace <workspaceRepositoryName>

The logic for this "diff" command is available  in com.ibm.team.filesystem.cli.client.internal.subcommands.DiffCmd class.

But the logc used in Diff command class, uses some Internal APIs (like CreatePatchUtil.writeDiff, etc) which I want to avoid using.Can you guide me on this.Thanks -Suresh

 

The mechanics how to access the data on the server is, as I believe in the blog. To do the actual diff, as tar as I can tell, the diff capabilities of the Eclipse client is used. I don't know if there is anything built into the server. Apparently something is in the Web UI, but I don't know where that API is, or if it is in the SDK. You could try to find information on that in the Eclipse forums (e.g. the class name). Then search the SDK using that name.

Your answer

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,926
× 1,201
× 169

Question asked: Nov 28 '13, 12:29 a.m.

Question was seen: 7,085 times

Last updated: Dec 16 '13, 11:50 a.m.

Confirmation Cancel Confirm