Skip to main content
Apr 17, 2014 12:53 PM UTC
Solved

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.

    Apr 17, 2014 8:16 PM UTC

    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.

    8 replies

    Apr 17, 2014 1:27 PM UTC

    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"
    Apr 17, 2014 5:00 PM UTC

    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.

    Apr 17, 2014 5:41 PM UTC

    You could try using:

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