Gnubie
Gnubie

Reputation: 2607

p4 sync Perforce command line to sync multiple trees to one changelist by entering the changelist only once

How can I sync 2 completely separate trees at a given changelist by entering the changelist only once, e.g. giving the same result as

p4 sync //tree1/a/b/c/...@1234 //tree2/d/e/...@1234

which works, but requires entering 1234 twice?

This gives "syntax error near unexpected token `('":

p4 sync (//tree1/a/b/c/... //tree2/d/e/...)@1234

This syncs //tree1/a/b/c/... to head instead:

p4 sync //tree1/a/b/c/... //tree2/d/e/...@1234

The main reason is that I want to make a shell alias but the 1234 part is user-entered, so it must be entered only once. I know I can use a shell script or function but for various reasons, I must use an alias.

Upvotes: 1

Views: 1379

Answers (1)

Caleb Huitt - cjhuitt
Caleb Huitt - cjhuitt

Reputation: 14951

From the comments, the (bash, at least) shell syntax of

p4 sync {//tree1/a/b/c/...,//tree2/d/e/...}@1234

should work. For more explanation, see the brace expansion section of the bash reference.

Upvotes: 2

Related Questions