Jump to content

Plastic CLI - How to checkout/checkin recursively with wildcard?


tom.peters

Recommended Posts

Good Day -

I need to be able to checkin a series of files through the CLI using a wild card so that they all hit the same changeset. For example, I have 90 folders, all of which have a file starting with "pc" and ending with ".sru". I'd like to be able to specify the root folder and have all such files checked in using recursion and a wildcard.

Here is what I thought would work: cm ci -R "C:\rootfolder\" "pc*.sru"

I don't want to specify each file in its own 'cm ci' because I will have 90 changesets. I want all 90 files checked in under one changeset.

Any ideas?

Thanks,

Tom

Link to comment
Share on other sites

Hey!

True to form, I must have mistyped something before (over and over because I tried it a few times). This works now, provided I am in the correct folder... However, I need to be able to do a recursive checkout/checkin for my workspace regardless of the current path location. You first example looks like I can, but I cannot seem to get that working.

Is there a way to specify the workspace so I don't have to CD to the path first?

Thanks,

Tom

Link to comment
Share on other sites

Hi Tom,

You can type the following command from any path:

cm ls <absolute_path_to_your_workspace_path>\pc*.sru -R --format={7} | cm checkout -

The command above lists all the files matching the pattern "pc*.sru" from the workspace path

you entered, and returns the full path of matching files ("--format={7}", as "cm help ls" states).

Then, the output of the "cm ls" command is piped to the "cm checkout" command, and the final dash

means that the input to the "cm checkout" command comes from the output of the previous command, the "cm ls".

Another option could be the following, if you're on windows:

dir <absolute_path_to_your_workspace_path>\pc*.sru /s /b | cm checkout -

To checkin those files, type the following command:

cm ls <absolute_path_to_your_workspace_path>\pc*.sru -R --format={7} | cm checkin -

or

dir <absolute_path_to_your_workspace_path>\pc*.sru /s /b | cm checkin -

-Jes

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...