perforceperforce-stream

Perforce stream copy doesn't seem like the right option


I'm just getting started on perforce streams and I'm confused about how to handle a pretty basic situation. Say that I have two dev streams each that are working on some specific, unrelated feature. My stream graph looks like this:

enter image description here

Let's say that I want main to have both dev1 and dev2 changes but I do not want dev1 to have dev2 changes or dev2 to have dev1 changes. I can easily copy my dev1 changes up into main. Since since I don't want dev1 changes in dev2 I can't merge main down into dev2. However, if I don't merge from main down into dev2 I will lose my dev1 changes in main when I copy dev2 up.

How do you get around this? Or is this how it's supposed to work?


Solution

  • You are correct that copy is not the right option!

    You'll need to merge into the mainline from dev1 and/or dev2. You can't use copy effectively in a scenario where you want streams to diverge from each other, since copy by definition forces things to be identical.

    Note that by default the copy operation should automatically detect that you're copying from a stream that has not already merged all of the mainline changes, and fail with an error regardless. (Assuming you're using the stream-aware version of the copy command -- if you just tell it "copy this depot path into this other depot path" then it'll merrily overwrite whatever's in the target.)