Question

I would like to create a branch in Perforce that is based off of some point in the past, i.e. not the current state of the current branch, is this possible? If so, how?

Here is a picture of what I'm trying to do. The current branch is in blue, and the new desired branch is shown in green.

enter image description here

Était-ce utile?

La solution

This will do it:

p4 copy //depot/project/dev/...@release_x_label //depot/project/release_x/...

The command tells Perforce to copy //depot/project/dev/... as of release_x_label to //depot/project/release_x/... You can run this command entirely server side using p4 copy -v. If you don't need a copy of the files locally it's much quicker.

You can do it in one go without needing a submit by using p4 populate

p4 populate //depot/project/dev/...@release_x_label //depot/project/release_x/...

I usually use copy though to make sure I don't have any typos. =)

You can do all of this with streams as well. It's a bit odd in that the revision specifier that you use to choose what to branch from gets put on the target path you're branching to.

p4 populate -rs //stream/dev2 //stream/dev2/...@1

This will populate dev2 from its parent as of changelist1.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top