Description

A licensee has reported a problem where FVisualStudioSourceCodeAccessor.AddSourceFiles is unable to handle two files being added at the same time. In this case, a .cpp and .h are added at the same time when a new class is created. Since FVisualStudioSourceCodeAccessor.AddSourceFiles has no way of handling a case where a "p4 add" fails due to it already being in the process of adding a file, the .cpp file is not added.

Edit: After speaking with the licensee further, this bug also causes the .cpp file to not be added to the Visual Studio solution as well.

Regression?: No
This also occurred in 4.17.2

Steps to Reproduce
  1. Download and install the P4VS plugin
  2. Create a new project and add it to a Perforce repository
  3. Open the .sln for the project and ensure that P4VS is enabled under Tools > Options > Source Control > Plug-in Selection
  4. Under Tools > Options > Source Control > Perforce - General, ensure that "Automatically add new files to Perforce" is enabled
  5. Connect to Perforce using the P4VS plugin
  6. In UE4, connect to Perforce Source Control
  7. In UE4, use File > New C++ Class... to add a new C++ class
  8. Once the compilation is complete, check your Pending Changelists in Perforce and the Visual Studio solution
    Result: Only the class' .h is marked for Add and only the .h is present in the Visual Studio Solution Explorer.
    Expected: The class' .cpp and .h are marked for Add and both files are present in the Visual Studio Solution Explorer.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-53121 in the post.

0
Login to Vote

Won't Fix
ComponentTools
Affects Versions4.174.184.19
CreatedDec 6, 2017
ResolvedAug 18, 2021
UpdatedAug 18, 2021
View Jira Issue