Typically when integrating you're operating on two different branches rather than two different revisions of a single file, and the goal is to merge them rather than append them -- what you're describing with br#1 and br#2 is a use case I haven't seen before.
Normally to create a branch you would do something like:
p4 integrate //depot/branch1/... //depot/branch2/...
p4 submit
This would create a new directory "branch2" with a set of files at #1, each an identical copy of the head revision in "branch1". Each branch is its own directory of files, with its own version numbering, and you can work on them completely independently. Then after making changes on both branch1 and branch2 you could do:
p4 integrate //depot/branch1/... //depot/branch2/...
p4 resolve
p4 submit
The "integrate" and "resolve" commands would merge the changes you made on branch1 into the changes you made on branch2.
Since you're simply looking to concatenate the revisions of a single file together, though, this is a very simple matter of shell scripting -- I'm following the names and contents used in your example (note that "//br" is not a valid file path in Perforce):
p4 edit //br
p4 print -q //br#1 | sed -e "s/foo/foo_branch1/" > br
p4 print -q //br#2 | sed -e "s/foo/foo_branch2/" >> br
p4 submit -d "concatenate and edit revisions 1 and 2 to make 3"
The "p4 print" command fetches the specified revision from the depot, and I'm using "sed" to make the edit (foo -> foo_branchN) automatically before appending it to the workspace file. At the end the concatenated file is submitted, making it #3.