Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

Most recent state id of file on stream/workspace through CLI

 Given a item UUID and a stream/workspace, how can I get the stateID (UUID) of the most recent version of the item? I need both UUIDs for the scm get file command. The best I can come up with is scm -u y show history and iterating over the change sets until the file is found (assuming that the change sets are in descending order) and pulling the stateID from it.

Help for: scm get file

Purpose:
  Extracts the content of a specific version of a file from the repository to a
  location on disk.

Aliases: get fi

Usage: scm get file [-r/--repository-uri <arg>] [-u/--username <arg>
                    -P/--password <arg> | --certificate <arg> -P/--password
                    <arg> | --smartCard -u/--username <arg>] [-o/--overwrite]
                    <item> <state> <path-on-disk>

  item         - The item id of the item to be extracted.  Supports UUID format
                 only.
  state        - The state id of the item to be extracted.  Supports UUID
                 format only.
  path-on-disk - The path where the extracted content must be loaded. The path
                 can be a absolute path or a relative path from the current
                 working directory.

Example:
Stream S has file F that belongs to three changesets: C1, C2, and C3. C1 and C2 have been delivered to the stream. C3 is in some private workspace. From the streams point of view, the file F's most recent stateId is that which is in C2. Hence, how would I get the stateId of F in S (which the most recent F in S came from C2)?

0 votes


Accepted answer

Permanent link
I don't think there is a way to find the stated id by having the stream/workspace and an item id. But you can get it if you know the path to the file in the component.
lscm -u y list remotefiles -w &lt;stream&gt; &lt;component&gt; /folder1/nestedfolder2/filename.ext
Mark Richardson selected this answer as the correct answer

0 votes

Comments

Yes thank you this will work for what I am trying to do. In fact it saves me a step. I can now use this:


scm compare -r <repo> -f o -I f stream <child> stream <parent>

Then per each file:
scm -u y list remotefiles -r <repo> -w <child/parent> <component> <path>

Then with each UUID + StateID
scm get file -r <repo> <UUID> <StateID> <Temp storage>

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 87
× 21
× 18
× 4

Question asked: May 02 '14, 11:03 a.m.

Question was seen: 3,555 times

Last updated: May 05 '14, 8:24 a.m.

Confirmation Cancel Confirm