How to get list of files within a changeset using lscm CLI?
![]() How can I get the list of files within a changeset using lscm commandline utility?
I couldn't find anything under "lscm list ..." or "lscm get ...."
|
One answer
![]() lscm list changes <changeset>
Comments Thanks, I have tried that. But it gives a lot of extra information. I am only interested in the files. I am looking for something that's equivalent to "git show --pretty="" --name-only <commitid>"
Current we do not have the capability to filter out certain information.
Are you using it to parse information? If so, it is easier to use the json output (-j/--json option).
Thanks, will look into that. That should help. Also, can I get the previous version of a file from a given changeset?
No, you cannot get to the previous version of a file from a given change set. What is the usecase you are trying to solve by getting the previous version of a file? Do you want to get the content of the previous version?
Yes, Right now I run "lscm show history .. " on a file to get all the changsets that this file was a part of, pick the second top most (i.e the last) one from the output and then run "lscm get change ..." to checkout the file in a separate path.
So I was wondering, if there's a better and a quicker way to do this.
If you want to get the content of a particular version of a file then you can use "lscm get file <file_itemId> <stateId_or_versionId> <path>". Note: There was an issue found with this with respect to symbolic links and was fixed in a later release.
I basically need last version (i.e last changeset) of a file which is a part of a current (latest changeset)
Also, where can I read about file item id, state id, version id ? I couldn't find any info on these terms.
To get the last version of a file what you did is the right way to go (lscm show history). Make sure you set the -m/--maximum (change sets to fetch) to 1.
itemId is an unique identifier to represent an item which could be a file, workspace, stream, component, baseline, snapshot, change set etc.
stateId is a unique identifier to represent a change in state of an item. In the file case, a new file version will have a new state id.
versionId was introduced in 5.0 and is similar to stateId but represented as numbers in increasing order for newer versions of files.
showing 5 of 8
show 3 more comments
|
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.