Is there a way to synch multiple files at specific revisions quickly.
For example specify a list of files and revisions as follows:
foo#1
bar#4
baz#3
I could sync these in a foreach loop in he shell individually - but this would be slow for large lists. So is there a quick/batch way of doing this?
I do know about using labels - but in this case we must assume no label existed for this set of files and revisions - the only source we have is the list as shown above.
You can use a file as an argument with the -x global option flag, as Bryan mentioned in his comment.
EXAMPLE - sync
-- Notice the file contents of 'syncfile.txt' with three filenames, at specific revisions.
$ cat syncfile.txt
foo#1
bar#4
baz#3
-- The client workspace currently has all the head revisions.
$ p4 have //depot/test/...
//depot/test/bar#5 - /home/admin/depot/test/bar
//depot/test/baz#4 - /home/admin/depot/test/baz
//depot/test/foo#5 - /home/admin/depot/test/foo
-- Now the file is passed as an argument with the 'sync' command, and the updates display
$ p4 -x syncfile.txt sync
//depot/test/foo#1 - updating /home/admin/depot/test/foo
//depot/test/bar#4 - updating /home/admin/depot/test/bar
//depot/test/baz#3 - updating /home/admin/depot/test/baz
-- Running the 'have' command again to verify that indeed the specific revisions were synced.
$ p4 have //depot/test/...
//depot/test/bar#4 - /home/admin/depot/test/bar
//depot/test/baz#3 - /home/admin/depot/test/baz
//depot/test/foo#1 - /home/admin/depot/test/foo
EXAMPLE - ADD
-- Notice the file contents of 'addfiles.txt' with three filenames.
$ cat addfiles.txt
who
me
you
-- The file is passed as an argument with the 'add' command, and the files listed are added.
$ p4 -x addfiles.txt add
//depot/test/who#1 - opened for add
//depot/test/me#1 - opened for add
//depot/test/you#1 - opened for add
Here are examples of how to use the '-x' flag in documentation:
http://answers.perforce.com/articles/KB_Article/The-x-Flag
http://answers.perforce.com/articles/KB_Article/Adding-a-Directory-Tree
http://answers.perforce.com/articles/KB_Article/Integ-Using-the-x-Global-Option
http://www.perforce.com/perforce/doc.current/manuals/cmdref/global.options.html
After discussion in comments, I understand a little better now.
If labels do what you want (basically sync to a set of files in a specific workspace at a point in time) then use them.
Where the idea of labels affecting depot performance comes in, is using labels incorrectly. Many companies and dev groups that moved from VSS (and some other systems) to Perforce used Labels in perforce like they used them in VSS - basically to mark a point in time. This allowed you to set a label for a version and go back to that if you wanted. In perforce every changelist is a point in time.
Labels in perforce don't work like this and when they are used to basically duplicate a changelist, and often a build system will create a label everynight, then they are a huge waste of performance.
In your case Labels are the correct solution, I suggest you read up on them and use them if they work for your scenario.