Search code examples
perforceunreal-engine4

What is this Perforce action?


enter image description here

I'm wondering what actions results in the left part of the graph, i.e. the red dashed arrow? This was done by Unreal Engine's Perforce plugin, when I renamed this file and submitted this change. The action shows add if I highlight that revision, but according to legend, this is a merge w/ edit action, so it doesn't seem to match.

The right part is my test, using P4V's move/rename action, and the action shows move/rename, which matches the legend Add (branch w/ edit), so this one seems fine.

So, what exactly happened in the left part? Is it really a merge w/ edit? Is it a correct result if someone is doing rename? Is move/add the only correct result when doing rename?

Thanks.


Solution

  • It's a mind-twister but there isn't necessarily a mismatch.

    First the actions: the first is an add because the new file is created in addition to the old one. In contrast, the second is a move/add because you're adding a file by moving it from the old location, hence the old one ceases to exist. Indeed, you start the whole exercise with one file, and end it with two (rather than with three, as you would if you performed two adds; or rather than with one, as you would if you perform two move/adds).

    Now the arrows. You're right the naming seems completely out of touch with the naming of the actions. I have no idea why there's the inconsistency.

    You're asking about the Merge w/ Edit specifically. Perforce has four similar but distinct actions that could have been used here: p4 integrate, p4 merge, p4 copy, and p4 populate. There are subtle differences that don't matter here. At any case, all these actions do "merge" the file so I think the naming is OK. Intuitively, I feel this could/should have been done by p4 copy (since the target didn't exist, so you didn't have to merge anything) but it's also perfectly possible that Unreal Engine decided to use p4 merge or p4 integrate anyway. That, I believe, explains why the arrow is a Merge. As for the w/ Edit, did you perhaps make a (textual) edit in the file while duplicating it?