Using "scm diff" with UUIDs as beforetype
I have a question regarding how to interface to the RTC command line tool "scm" in a very specific automated nightly build scenario:
Let's assume we have a sandbox with the local copy of a repository workspace already set up. After the automated build updates the local content using "scm accept" to bring in the latest changes from the stream, we want to find out "file revisions" of all files now loaded into the sandbox. It looks like "scm --show-uuid y list remotefiles" is doing exactly that: showing each file (and directory) in the local sandbox together with the object selector and version selector of the file in its current state. Then it looks like you can make use of the object selector and version selector in the command "scm get file" to fetch the contents of a single file in the future in a very specific version (like it was recorded earlier with "scm list remotefiles" above). What I am missing now is the possibility to use the version selector together with the "scm diff" command's "beforetype" in order to diff the version of the file currently in the sandbox against an older version using a previously recorded version selector. Alternatively - if there is no way to diff using a version selector UUID - is there a way to get the numbers of the latest changesets the files in the sandbox were modified in? So that we can record the most current changeset for each file (instead of the version selector) and then use "scm changeset extract" instead of "scm get file" to fetch the file and "scm diff" with "changeset" as "beforetype"? Thanks for your help in advance! |
One answer
Hi Stefan,
The "beforetype" for file is not supported by "scm diff" command line.
This question was answered in https://jazz.net/forum/questions/48283/scm-diff-with-beforetype-quotfilequot.
You can use "scm show history <filename>" command to find the change set history in the sandbox. If you use parameter "--maximum 2", the last listed change set is the changeset you are looking for.
Hope that's helpful.
Comments
Stefan Bellon
commented Aug 06 '14, 2:21 a.m.
First of all, thanks for your quick answer.
Lily Wang
commented Aug 06 '14, 8:34 p.m.
I can not think a way to list the latest change set for all files as each file has different history.
Actually if you are using RTC build, a snapshot is created for each build if you have "Jazz Source Control" pre-build in the build definition. The snapshot is created in the build workspace so you can use "scm list snapshot" to get the snapshot name and uuid. Then you can use the snapshot as the "beforetype" of the "scm diff" command to get the difference of a file between current build and last build.
Stefan Bellon
commented Aug 15 '14, 5:45 a.m.
I think I'll try the following:
|
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.