cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Can I get a files/versions list based on labels?

ptc-5708445
7-Bedrock

Can I get a files/versions list based on labels?

I'd like to know si commands for retrieving a list of files and their versions from a Project based on labels on the files themselves. So I'm after a list of all files with a label from a project.

I'd like to know a similar cli means of retrieving the files/versions from a Project if the Project checkpoint itself is what is labeled, which might first mean getting the Checkpoint based on the label, then getting the files based on the checkpoint.

ACCEPTED SOLUTION

Accepted Solutions

I'm using Perl scripts as an interface, so replace $projectName, $checkPoint, $user and $password with a real stuff...

si viewproject -P $projectName/project.pj --projectRevision=$checkPoint -R --yes --filterSubs --xmlapi --user=$user --password=$password

--xmlapi is optional

I was able to get this to work.

View solution in original post

8 REPLIES 8
tdalon
12-Amethyst
(To:ptc-5708445)

See http://communities.ptc.com/message/237487#237487

  • Get Checkpoint timestamp
    • using e.g. si viewprojecthistory --sandbox=$MKS.sb --fields=revision,labels,date,description
  • Create build sandbox
    • using e.g. si createsandbox --forceConfirm=yes -P$MKS.pj --projectRevision=$rev --gui --noopenView
  • Checkout with revision at time=checkpoint timestamp
    • using e.g. si co --sandbox="sandboxpath" -R --nolock --revision="time:01.01.2014 13:00"

I need the information, not the sandbox and file content. This would be prior to the creation of a sandbox or to help determine whether a sandbox needs to be sync'd as a whole or for individual files.

You could try using:

si viewproject -R --project=/some/project/name/project.pj --filtersubs --filter=label:MyLabelGoesHere

tdalon
12-Amethyst
(To:JoeBartlett)

This assumes you also use/propagate checkpoint label on member level. Our Admins don't allow it because of performance issue.

It would be nice if one could get the list of the files in a checkpoint even if the members are not labeled.

I've tried the option --projectRevision=1.2 but I get a CLI error I don't understand.

I'm using Perl scripts as an interface, so replace $projectName, $checkPoint, $user and $password with a real stuff...

si viewproject -P $projectName/project.pj --projectRevision=$checkPoint -R --yes --filterSubs --xmlapi --user=$user --password=$password

--xmlapi is optional

I was able to get this to work.

tdalon
12-Amethyst
(To:ptc-5708445)

It does not work for me.

Do you use for the projectRevision the revision number for example 1.2?

What is this --yes for?

Hint: You don't need to use the password at each command. If the user is connected it is not needed.

To connect use the si connect --gui command. This way you don't have the password stored/visible in your code.

tketz
12-Amethyst
(To:tdalon)

Hi,

i tried following syntax:

si viewproject --projectRevision=1.3 -P "project"

This command lists all members with his revision at ProjectCheckpoint 1.3

@Thierry Why you get an CLI error? Typo or does the Checkpoint you tried (1.2) does not exists in the specified project?

tdalon
12-Amethyst
(To:ptc-5708445)

I don't understand really your Use Case.

If you want to see if your sandbox has diff you can use other command like viewsandbox with some filteroptions like --filter:changed.

You can also resync with filteroptions. One common useful filter is --filter=!locked:%USERNAME%.

Announcements


Top Tags