[closed] How can I extract the files from a changeset to the filesystem?
- Right click the component under the stream and select "Show > History"
- For the desired change set right click and select "Open in Change Explorer"
- For the file that I want to save right click and select "Load"
The question has been closed for the following reason: "The question is answered, right answer was accepted" by spriteburn Sep 02 '14, 2:47 a.m.
Accepted answer
I'm not familiar with a way to do this via Eclipse (I went through a couple flows in my RTC 5.0 Eclipse client and didn't see anything related to what you are looking for.)
However, you can do this via the CLI, so if you are comfortable with some scripting this can be your workflow (for some reason IBM doesn't have this CLI command advertised in the 5.x documentation, but it's still there.)
1. Script up something to run this command: http://pic.dhe.ibm.com/infocenter/clmhelp/v4r0m3/topic/com.ibm.team.scm.doc/topics/changeset_extract.html - This will extract the changeset's versionables to an output directory.
2. If you are in the Eclipse Component History, for example (Show -> History) and you want to extract a specific changeset, you can right-click the changeset and select 'Copy URL' then paste into Notepad or something, you should get something like 'https://myrtc.com/ccm/resource/itemOid/com.ibm.team.scm.ChangeSet/_zd9z0up6EeOX2fFKCpeFrQ?Workspace=_6GU9Edq5EeKrDorZ-x_CeQ' and you can grab the changeset UUID from there and feed it to the script (using the workspace UUID which is also at the end of the URL.)
Obviously it would be nice to just do some mouse clicks to do this from the Eclipse GUI, but this gives you something workable you can improve upon.
Comments
Thank you Winston.
Andrew Trobec,
After checking the 4.0.6 and 5.0 CLI documentation, IBM changed the 'changeset extract' command to 'get change', it doesn't look like you have this in 4.0.3, so you're stuck with the former, slower command (in my environment 15 seconds versus 4 seconds.)
The command doesn't work, I suspect, exactly as you'd like it to by default, meaning it will not simply extract all the changes in a changeset to the filesystem in one-shot (which would have been preferable here.)
What you have to do is list the changes in the changeset and extract one-by-one:
1. scm.exe --non-interactive --show-uuid y list changes -r MY_CREDS --workspace wkenos_dev_test_ws _hQ1mEQFlEeSoZb4hDFKBcw - This will list all the changes in the changeset and their item IDs.
2. scm.exe --non-interactive --show-uuid y get change --overwrite -r MY_CREDS --workspace wkenos_dev_test_ws _hQ1mEQFlEeSoZb4hDFKBcw /scripts/common.xml C:\TEMP\component\scripts\common.xml
Wash, rinse, repeat for each versionable file in the changeset.
1 vote
IBM has a Perl script posted that does essentially what you want and it should work for 4.0.3. Their script diffs 2 streams and then writes out the diff content to the filesystem:
http://www.ibm.com/developerworks/rational/library/rational-team-concert-command-line-reference/index.html?ca=drs (download is at the bottom, a zip file.)
I think the main problem for you, and you'll have to test, will be speed. The command on my end isn't that fast, and it could take minutes to extract a larger changeset of just a few dozen changes. It would be nice if IBM modified the command to optionally extract the full changeset's versionsables to an output directory with or without the component roots.
1 vote
Andrew Trobec,
'get change' in RTC 5.0 does not extract all changes in one swoop, but it extracts each file in seconds so it's quite a bit faster as well.
The RTC command-line source code is available in the RTC SDK (part of the jazz.net download products), if you're interested in trying to enhance it for your own ends, although I don't know how much work that is.
You might want to subscribe to this RTC work item: https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=203315
This work item is in the IBM production database that requests this feature, unfortunately it's been on backlog for a while now. IBM uses a separate RFE process to prioritize things out of here, so you'd have to open one of those to get any sort of traction.