Merge does not work as expected (Perforce)

Firstly, apologies for the long post, but I thought I’d be as thorough as possible. Thanks in advance for your time.

How I think it should work (my workflow might just be incorrect).


Set up a conflict using (what I think is) standard perforce workflow when two devs work on the same feature

  1. Brand new Perforce (Stream) Depot
  2. Create 4.9 Basic Code project (no Starter Content) in a temp folder (MergeProject), and close it immediately
  3. Create a new mainline stream, “main”, using P4V
  4. When asked, “Copy files from the local file system”, drag in your entire Unreal Project folder (“D:/temp/MergeProject”).
  5. Remove the cruft (Build, Intermediate, .sdf, .sln, Saved)
  6. Create a development stream “dev” from main
  7. In dev, open the project and connect to source control
  8. In dev, create a blank actor blueprint (“BP_MergeTest”), which OnBeginPlay Prints a String “Hello”
  9. Add and submit it to source control (description: “base”)
  10. Create two task streams from dev, “task a” and “task b
  11. In task a, connect to source control, and change the string from “Hello” to “SOMETHING”
  12. Checkout and then submit your changes (description: “a change”).
  13. After this change, it should look like this:

66211-after+task+a+change.png

  1. In task b, connect to source control and change the colour of the string to red
  2. Checkout and then submit your changes (description: “red text”)

The desired conflict resolution workflow from here would be:

  1. task a Copies Up to dev and submits
  2. task b then needs to Merge Down from dev
  3. It should look like this:

66212-after+task+a+copies+to+dev.png

  1. Merge down, don’t resolve conflicts
  2. Open Unreal as task b, right click the blueprint → source control → merge (or file → merge, whatever)
  3. View the Base in the middle (Blue Hello), the “SOMETHING” string on the left (or right) and the RED version on the other side
  4. Be able to select “SOMETHING” and RED using Accept Source and Accept Target on two different entries
  5. Finish Merge
  6. Save (checkout) and Submit

The Two Issue(s)

Firstly, at step 6, what I actually got was:

Secondly, after hitting Accept Source (or Accept Target, I’ve tried both):

"The asset '/Game/BP_MergeTest' (BP_MergeTest.uasset) failed to save.

Cancel: Stop saving all assets and return to the editor. 
Retry: Attempt to save the asset again. 
Continue: Skip saving this asset only."

And the Merge cannot continue.


The Request

Please inform me of how I am actually meant to set up my Perforce project to assist in this, if the method that I have used is not the correct one.

There is very little information available about this tool, and we are about to embark on a project which may prove to be incredibly useful to have this functionality. It would be nice if the documentation was updated (or more prominently visible).

Finally, is there any way to hook up P4V so that it uses the [console diff (merge) command][4] for UE4Editor?

From the command-line, run: UE4Editor.exe -diff [options]

Hey -

For the first issue you mentioned (the third screenshot), if I understand correctly the issue is that the text says “Hello” rather than “SOMETHING”. Assuming this is the problem then the solution is to have task b sync to dev before editing. Since task a and task b were created at the same time they both see the same blueprint. When task a makes changes and submits the changes they are submitted to dev, but task b does not receive the changes until it syncs to dev and sees that the file has changed and updates. In this sense it is always a good idea to sync before working on something to ensure that you are working with the latest version of the file. This should also help with the saving issue since it should reduce the chances of running into conflicts. Let me know if you’re still having issues with saving following this workflow and we can investigate further.

Cheers

Your terminology is odd. Perforce does not have a “sync” as far as I am aware.

I have merged down from dev to task b so it should be there, but it is not.

The workflow you have outlined does not appear different from what I have written.

HEy -

I missed that you were using Streams in Perforce. Let me do some additional testing and I will respond when I have an update.

Thanks!

I’ll try and run the same method without streams, although I think that the added functionality is particularly nice.

Have you had any chance to test this further with Streams?

I am looking at using a classic depot now, but the functionality is far less impressive.

Hey -

I apologize for the delayed response. I’ve tried to look into this issue but have not seen the behavior you mention. Given your flow above, after “task a” copies up to dev and then task be merges down from dev, what is the status of the blueprint node? Does it show “SOMETHING” in red/blue text?

Cheers

The merge is conflicted, and the only resolution options (when you go to the merge function within UE4) is what you see in the last picture (obviously incorrect).

I have gotten another developer in our offices to follow these steps and he gets the exact same issues. I think that it should be replicable.

Hey -

Sorry for the delayed response. To answer your question about hooking P4V into the diff tool, I can say that yes it is possible. Inside Perforce, if you go to Edit->Preferences->Merge you can add your own custom merge tool for .uasset files. The following screenshot shows how to setup the parameters:

As for the problems with merging, I am still trying to find answers to what is happening. After speaking with other developers the middle “base” blueprint from the screenshot does not appear to be correct. We’re also looking into the error you receive when choosing the Accept Target / Accept Source option.

Thanks for the update.

Are there any further updates? Is it specifically because I am trying to use Streams?

There is currently no update to this yet. I can’t say for sure if this is a Streams issue as I’ve not been able to reproduce the exact issue. If you are consistently seeing this problem can you test the same process outside of streams to see if you have the same behavior?