views:

39

answers:

1

Hi -

How do you branch from a specific changelist in perforce? That is, if main is my main codeline, and I want to create a branch b off of main from a changelist n, what is the syntax to do this?

I've tried:
//depot/main/...@n //users/me/sandbox/...
in my branch spec, but get errors.

And
p4 integrate -b branch_b @n
doesn't seem to work either.

Thanks in advance.
-David

+2  A: 

Based on the highly scientific method of attempting the same action in p4v and then copying and pasting out of the log, the following snippet should do what you need, provided you have your branch specification branch_b defined correctly:

p4 integrate -o -b branch_b -s //depot/main/...@n
ninesided
I realize your "highly scientific" was intended to be tongue-in-cheek, but actually I think it's a great way to learn about Perforce command line techniques for particular situations. I use that same "scientific" method myself, routinely.
Bryan Pendleton