Skip to main content
1-Visitor
April 17, 2014
Solved

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

  • April 17, 2014
  • 1 reply
  • 6618 views

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.

    Best answer by ptc-5708445

    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.

    1 reply

    1-Visitor
    April 17, 2014

    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"
    1-Visitor
    April 17, 2014

    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.

    21-Topaz I
    April 17, 2014

    You could try using:

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