Perforce - quickly sync multiple files with certain changes

Is there a way to quickly synchronize multiple files with certain versions.

For example, list the files and fixes as follows: Foo # 1 bar # 4 Base # 3

I could synchronize them in the foreach loop in my shell individually - but that would be slow for large lists. So is there a quick / batch way to do this?

I know about the use of tags, but in this case we should not assume that there is no tag for this set of files and revisions. The only source we have is a list, as shown above.

+3
perforce sync
source share
2 answers

You can use the file as an argument with the -x global flag, as Brian noted 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 

The following are examples of using the -x flag in the 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

+3
source share

After discussing the comments, I understand a little better.

If tags do what you want (basically sync with a set of files in a specific workspace at a specific point in time), use them.

If the idea of ​​labels affecting depot performance comes up, it uses labels incorrectly. Many companies and development groups that switched from VSS (and some other systems) to Perforce used shortcuts as they used them in VSS, mainly to mark a point in time. This allowed you to set the label for the version and return to it if you want. In perforce, every change list is a point in time.

Shortcuts in perforce do not work this way, and when they are used to basically duplicate a list of changes, and often the build system will create a shortcut every night, then this is a huge waste of performance.

In your case, Shortcuts are the right solution, I suggest you read them and use them if they work for your script.

+1
source share

All Articles