It's all about the answers!

Ask a question

[closed] Changesets - Find/Deliver programatically [Plain Java API]


0
1
VK L (8177136159) | asked Jun 03 '15, 3:52 p.m.
closed Jun 08 '15, 8:12 a.m.
Hi All,
I have changesets shared across multiple streams. I need to find whether a changeset exists in the Repository and deliver the existing across streams. If it doesnt exist, create a new changeset.
1. How to get the id of a changeset and use it in a find query?
2. How to deliver selective changesets from the repository to a particular stream

Please advise. Thanks.

The question has been closed for the following reason: "The question is answered, right answer was accepted" by valli Jun 08 '15, 8:12 a.m.

3 answers



permanent link
sam detweiler (12.4k6180201) | answered Jun 05 '15, 7:23 a.m.
 I think you would be better off to use the commandline. the API for SCM is not simple. This is an object oriented system.

Comments
VK L commented Jun 05 '15, 8:07 a.m.

Hi Sam, I am trying to develop a Java utility for migrating SCM Code-versions into RTC. I am getting the uuid after a changeset creation and using it for a later check.
Is there a simpler way to find a changeset by comment/name, etc? (or) a find method to search by itemid/uuid?


sam detweiler commented Jun 05 '15, 8:13 a.m.

Sorry, I don't know the SCM apis enough to help here.


VK L commented Jun 05 '15, 10:18 a.m.

Thanks Sam. Using SCM Command-line utility - Is it possible to check-in/deliver 2 versions of same file tagged to same changeset?
Is it possible to check-in or deliver a file-version without delivering the changeset?

I have a Source-SCM Tool which has 2 versions tagged to 1 ccid, which we are trying to migrate into RTC, so i am just checking on the possibilities. 

Thanks.


sam detweiler commented Jun 05 '15, 10:28 a.m.

RTC ONLY has changesets..  so, when you checking and deliver, it is a changeset that is provided..  the system does not store 'files'.  even at the beginning, its a changset from nothing to everything.

so, can u have two differences for the same object in the same changeset? I would say no.

also, no.. you cannot checking/deliver without a changeset..


VK L commented Jun 05 '15, 10:47 a.m.

When i checkin file1 under changesetA -> I assume that its Version1 of File1.
When i change file1 and do a second checkin under changesetA -> It merges the contents and shows it as Version1 itself.
I was expecting the 2 checin operations to provide 2 versions of File1.

*Finally after all the checkins, i am delivering the changeset.


sam detweiler commented Jun 05 '15, 11:05 a.m.

sorry, don't understand..

there is only ONE 'current' state of a file.. all its current changes applied.
what it looks like under the covers (2 changesets) and what is shown in the UI (one file with all the changes applied). are different topics.

I don't know (again, not my specialty area), that the initial/baseline is version 0.


Geoffrey Clemm commented Jun 06 '15, 12:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

WRT last comment by VK-L, yes, until you "complete" a change set, you can checkin the same file as many times as you want to the same change set, and yes, this will create a new version of that file in the repository for each checkin.   By default, when you look at the content of a change set in the GUI or the command line, it will give you the content of the last version of each file in that change set, but you can ask the Eclipse GUI to show you all the versions of that file that you checked in.   I'm not sure if the command line or the other GUI's let you do this.


VK L commented Jun 06 '15, 3:19 p.m.

Thanks Geoff. Actually i checked-in 1 file multiple times with the same changeset, it looks like its committing the changes onto the same version. I used the below API command for file checkin to the changeset:
fWorkspace.commit(fChangeSet,Collections.singletonList(fWorkspace.configurationOpFactory()
.save(fileWorkingCopy)), fMonitor);
When i view the File-history or at the changeset level, i see only 1 version of it, even though i have done 2 commit-actions with 2 different contents.


VK L commented Jun 06 '15, 3:28 p.m.

Looks like Changeset deliver only creates the actual file version and not the  commit. So all checkins of 1 file are combined to a single version and delivered when changeset is delivered.

showing 5 of 9 show 4 more comments

permanent link
VK L (8177136159) | answered Jun 06 '15, 3:19 p.m.
Thanks Geoff. Actually i checked-in 1 file multiple times with the same changeset, it looks like its committing the changes onto the same version. I used the below API command for file checkin to the changeset:
fWorkspace.commit(fChangeSet,Collections.singletonList(fWorkspace.configurationOpFactory()
.save(fileWorkingCopy)), fMonitor);
When i view the File-history or at the changeset level, i see only 1 version of it, even though i have done 2 commit-actions with 2 different contents.

Comments
VK L commented Jun 06 '15, 3:51 p.m.

Looks like Changeset deliver only creates the actual file version and not the  commit. So all checkins of 1 file are combined to a single version and delivered when changeset is delivered.


Geoffrey Clemm commented Jun 06 '15, 4:58 p.m. | edited Jun 06 '15, 4:59 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

What did you use to view the file history?   Did you use the Eclipse client, and in the history view on the file, did you select "Show Check-In History" in the View menu of the History view?   (It is off by default).


VK L commented Jun 06 '15, 5:20 p.m.

Actually, i check-in FileA multiple times from repository-workspace to the changeset & the changeset is not delivered to the stream yet. I right-click on the file in wrkspace of Eclipse GUI and "Show History" - it shows only 1 version tagged to this Changeset and content is latest..
After delivering changeset1, If i check-in File-2nd version under Changeset-2, i see it as 2 different versions on "Show History"


1
Geoffrey Clemm commented Jun 06 '15, 5:57 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I predict that you neglected to select "Show Check-In History" in the View menu of the History view.


VK L commented Jun 07 '15, 3:55 a.m.

I am on 4.0.1 version and i dont see a View menu in History view.Please advise.


VK L commented Jun 07 '15, 8:52 a.m.

Thanks Geoff - I can see the checkin-history with the different versions. Since there are 2 different set of version-views -> 1 based on changeset and other at checkin level, are the different checkin-versions available for a load and modify by users in their workspace?


Geoffrey Clemm commented Jun 07 '15, 10:34 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Note: There is one version tree, but two different views of it with different levels of detail (one that only shows "end versions in a change set" and the other that shows "all versions in a change set").   There must be Java API to access the finer granularity (i.e. at the checkin level), but we'd need someone familiar with the Java API to provide a pointer on where to find it.   Note that you can retrieve the content of those checkin versions from the Eclipse UI ... I don't know if any of the other UI's provide access to them.

showing 5 of 7 show 2 more comments

permanent link
Ralph Schoon (57.7k23642) | answered Jun 08 '15, 3:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER