Load all files modified by changetsets linked to an WorkItem via SCMTools
Hi,
Every changeset is associated to an work item. I would like to load the files modified by those changesets via SCMTools.
I think the easier way is to generate a loadrules file to be used with "scm load" command. But my question is: How to generate this loadrule file?
Is there any command to list all change sets associated with an WorkItem? And is there any command to list all files modified within a change set?
Thanks,
Accepted answer
You can list the changes of a change set using the "list changes" command.
Starting 4.0.6, a new --workitems option was added to the "list changesets" command to list the change sets associated with the workitem. You can also list the change sets of dependent workitems associated that workitem by specifying the --include-child-workitems option.
You can use the "get change" command to get the file downloaded to the local disk. Note: This command currently accepts only one file and is not equivalent to load as RTC will not track that file if it is downloaded to a non-sandbox location.
Comments
Thank you, I'm starting to see the light :)
I'm struggling with some aspects...
When I use the "list changes" it returns this:
Change sets:
(5102) ----$ Eduardo Bello "<No comment>"
Component: (1078) "Pitang Component"
Modified: 30-Jun-2014 01:25 PM
Changes:
---c- (5104) /<unresolved>/messages.properties
---c- (5105) /<unresolved>/messages_bk.properties
---c- (5106) /<unresolved>/messages_en.properties
Note the "/<unresolved" path. If I open this changeset via Eclipse or Web client, the full path is displayed.
Any idea how can I get the full path?
Thanks.
where do those files with the unresolved go when you actually load them? the root of the component?
To resolve the file paths you need to specify the context and that context is the workspace or stream. Use the -w/--workspace option to specify it.
If you were within a sandbox, the context would be determined implicitly from the sandbox.
1 vote
Hi,
Thank you for the help... I still facing troubles..
Using "-w workspace" works to get full path. But "get change" only seems to work if I already had an workspace loaded. And that's not the case.
My goal here is to inform an work item id, and then use scmtools to "download" all files that were modified and delivered to a changeset associated with the WI. I don't need to check-in or deliver the files back, I just want to download to run a third-party script using those files.
And I want to download the most recent state of the file, downloading from the stream. But just looking for the changesets I couldn't identify in which stream the file is.
Any ideas?
I was able to download the file in the change set without loading the workspace. Note: Do not use alias in the script, use UUID. To list the UUID's use the -u option. For example your command would look as follows:
lscm -u y list changesets -W <workitem number>
lscm list changes <change set UUID>
lscm get change <change set UUID> <change UUID> <path of the file on disk>
I don't believe you can get the stream info by referring to a change set. You need to know the workspace/stream the change set is in.