Jump to content

List all files (not just revised files) in a changeset


hypotheticalEric

Recommended Posts

I'm struggling to get a list via the command line of all the files that exist in the repository at a given changeset point.  In other words, if I created a workspace from a changeset, can cm give me a list of all the files it would download?  I guess this is also similar to "browse repository for this changeset" - but on the command line instead of GUI.

 

This is part of a python tool that will submit build jobs to the automated build system, and in the UI to create the job I want to let the user specify a changeset / repository combination and then see a list of files that matches a filter.  All the connection to Plastic is done via shell commands that use cm and cm find.

 

A few wrinkles that are tripping me up:

  • I need to be able to get this info without having the workspace on the machine the user is on.  Often these jobs are submitted by remote machines that won't have any version of the repository downloaded in a workspace.
  • I need to get the whole tree, ideally in one command that lists all the files recursively.  I've been unsuccessful with cm ls and cm cat so far, but maybe I'm not using them right.
  • It needs to be cross platform (Windows + Mac at least, Linux would be nice as well).

Anyone have experience with this sort of thing?

Link to comment
Share on other sites

Got it working after a little more trial and error - I hadn't seen the extended documentation for the ls command which allows recursion and specifying a changeset (cm ls --help give you this info).

 

For anyone who is interested, the command goes something like:

cm ls -R --tree=<changeset path> --format="{path}"

and you don't have to be in a workspace either.

Link to comment
Share on other sites

You are right!

 

The incoming "5.4.16.675" release will accept branch specs for the --tree parameter. These branch specs will need to begin with the usual 'br:' prefix to tell them from changeset specs, e.g.:

cm ls /code --tree=br:/main/scm13596@myrep@denver:7070

 

Plastic will translate the banch spec to the head changeset value for you.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...