Hussein Khalil
Hussein Khalil

Reputation: 1615

Perforce: Is it possible to execute an integrate command on multiple files (not folders)?

I'm trying to execute an "Integrate" perforce command (see: http://www.perforce.com/perforce/doc.current/manuals/cmdref/integrate.html) on a list of files and not on a single file or a specific folder.

Is such a thing possible ?

In other words, is it possible to specify multiple files (and their respective integration paths) in one command ? This would save me the trouble of having to call this command for each file that I'd like to integrate and in the process reduces the number of round-trips on the P4 server.

If not, do you have another command to recommend?

Thanks

Upvotes: 2

Views: 3142

Answers (3)

Jamie
Jamie

Reputation: 7945

You can operate on a filelist using:

p4 -x filelist.txt

See

p4 help usage

The -x flag instructs p4 to read arguments, one per line, from the specified file. If you specify '-', standard input is read.

You could pass the arguments to p4 integrate directly this way or you could use the same method to create a label

p4 -x filelist.txt tag -l mylabel

And then reference the label on source side of an integration

p4 integrate //depot/src_stream/...@mylabel //depot/target_stream/...

Upvotes: 0

Chance
Chance

Reputation: 2700

In p4v you can Ctrl+click multiple files, then right-click and choose to Integrate them. I don't think you can do anything fancy as far as integration paths; that is if you are integrating two files in the same source directory it will assume the same target directory. Or, if you are integrating two files dev/dir1/file1 and dev/dir2/file2 you can choose dev2/... as your target directory and you will have dev2/dir1/file1 and dev2/dir2/file2.

Edit to add: If you are looking for a command line solution, you can use Laurence's and edit the branch specification to your heart's content.

Upvotes: 0

Laurence Gonsalves
Laurence Gonsalves

Reputation: 143144

You could create a branch, and then integrate through the branch. I know that sounds weird, but in Perforce all a branch is is a set of integration mappings stored in the server. You then use -b on p4 integrate to specify the branch.

Upvotes: 5

Related Questions