[closed] Changesets - Find/Deliver programatically [Plain Java API]
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
Comments
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?
Sorry, I don't know the SCM apis enough to help here.
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.
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..
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.
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.
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.
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.
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.
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
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.
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).
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"
I predict that you neglected to select "Show Check-In History" in the View menu of the History view.
1 vote
I am on 4.0.1 version and i dont see a View menu in History view.Please advise.
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?
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.