Commit Graph

136 Commits

Author SHA1 Message Date
luc eygasier
8a36dd39f0 Adds automatic discovery of potentially modified files out of SourceControl.
* Adds reconcile contextual actions to manually trigger the verification process
* Loads UncontrolledChangelists module along UnrealEd to be able to hook loaded/saved files sooner
* Adds CPU Trace for FPerforceUpdateStatusWorker::Execute and ParseUpdateStatusResults
* Changes FPerforceCheckOutWorker to update Changelist State if checked out directly to a CL
* Changes FPerforceRevertWorker to update Changelist State after revert

#rb Sebastien.Lussier

#changelist validated

[CL 16477108 by luc eygasier in ue5-main branch]
2021-05-26 18:15:46 -04:00
paul chipchase
491d217cd8 Remove the defunct define 'USE_P4_API' from the PerforceSourceControl module.
#rb Sebastien.Lussier
#rnx

* Reasoning
- It was originally added as a way to tempoarily disble the perforce C/C++ api because we did not have access to VS2015 libs at the time.
- The code no longer compiles when USE_P4_API was set to 0 so would need to be fixed up to make it useful.
- We have no plans to disable the api making the define a bit pointless.

* Changes
- Now we can be sure that FP4ClientUser is derived from the real version of ClientUser we can mark the overriden methhods with virtiual and override keywords to make it more obvious.
- Removed some pointless comments, like // Constructor.
- Added comments to overriden methods that were missing them.
- Changed some // comments to /** */ to keep consistency in the code.
- Replaced occurences of NULL with nullptr.
#preflight 60ae032bbb30900001e85029

[CL 16465723 by paul chipchase in ue5-main branch]
2021-05-26 05:07:41 -04:00
paul chipchase
363a34db32 Allow the FSharedBuffer to take direct ownership of the byte array collected during perforce commands.
- This prevents the additional allocation, memcpy and spike in memory use.
- Made FP4ClientUser::DataBuffer private to force it's access via ::ReleaseData

#rb Per.Larsson
#rnx
#preflight 60a6546fb7ccb00001afe5df

[CL 16401395 by paul chipchase in ue5-main branch]
2021-05-20 09:04:59 -04:00
paul chipchase
18dc064335 Add support for downloading a file from source control directly without actually checking it out (ie p4 print) and add additional support so that the command can be called from a background thread.
- Only implemented for perforce source control at the moment.
- The source control operation FDownload file can be used just like any other command via ::Execute BUT it will also work with the new method ::TryToDownloadFileFromBackgroundThread which unlike ::Execute can be called from a background thread.

#rb Sebastien.Lussier
#rnx
#preflight 60a2290322cce000014243ae

* PerforceConnection
- Extend ::RunCommand to take an optional FSharedBuffer reference which can be used to return text/binary data downloaded as part of a perforce command
-- Ideally we would replace all of the out parameters with a single struct but that level of refactor would be better suited to its own submit.
- Removed the bool parameter for FP4ClientUser and replaced it with a set of flags instead
- Added a flag to allow FP4ClientUser to store data, either in binary or text format from a perforce command. Although in general this will be the result of a p4 print command.

* PerforceSourceControlCommand
- No longer assert if the command is not on the game thread if the operation indicates that it is safe to run on a background thread.

* PerforceSourceControlModule
- Register the 'DownloadFile' worker

* PerforceSourceControlOperations
- Add FPerforceDownloadFileWorker

* PerforceSourceControlProvider
- Adding implementation for ::TryToDownloadFileFromBackgroundThread.
-- This method is thread safe compared to the normal ::Execute call due to:
-- 1) This method does not accept any callbacks as the most common use of callbacks with ::Execute is to update the UI.
-- 2) This method does not add the command to any of the internal queues nor rely on Tick to process the command.
-- 3) The worker is invoked directly from the calling thread rather than as a background task.
--4) This method does not allow commands that modify the cached states as this would be very difficult to manage without rewriting how all commands are processed to make sure that they are only run one at a time and the results processed in order. NOTE that async commands can be issued from the game thread and can in theory be run in any order on the p4 server depending on how the background task processing works out with no certainty as to the order the results will be processed in. It is unlikely that we will process results out of order but not impossible, but this is a pre-exisiting issue with the current API, extending it to be fully multithreaded will just make it worse.
-- Note that we do not explicity check if the command supports being called from a background thread, as creating the command will check that anyway.
- Calling ::OutputCommandMessages is now thread safe. When called from the game thread it will issue it's output via FMessageLog as before but when called from a background thread we will use the UE_LOG macros instead. Marshalling all output in the same way is something we will need to solve when/if we make the entire API thread safe.

* PerforceControlSettings
- Improve thread safety when calling ::GetConnectionInfo
- If the password is stored in the UI then this is not thread safe but that feature is hidden at the moment due to being unsecure. I am unsure if we want to move the password to be stored in a member variable that can be accessed from any thread and only updated via the UI or not.

* SourceControlOperations
- Add new FDownloadFile operation.
- This can either download the file(s) to FSharedBuffers which can be accessed by calling ::GetFileData OR directly to a directory on disk if the target directory is supplied as part of the constructor.

* ISourceControlOperation
- Add a new base method CanBeCalledFromBackgroundThreads (false by default) which can be overriden by derived classes and return true to indicate that the operation can be run from a background thread. This is intended for use by FDownloadFile with the perforce source control provider in lieu and making the API fully thread safe.

* PerforceSourceControl.uplugin
- Move the perforce plugin to load as early as possible as if Mirage is to use it then we need it to be avaliable before we start loading any potentially virtualized data in packages.

[CL 16346666 by paul chipchase in ue5-main branch]
2021-05-17 05:06:44 -04:00
luc eygasier
0ab85e473c Removes FStatus operation in SourceControl.
Adds Modified State check by Hash for PerforceSourceControlProvider.
#rb Sebastien.Lussier

#changelist validated

[CL 16332246 by luc eygasier in ue5-main branch]
2021-05-14 14:01:14 -04:00
luc eygasier
a5608833a9 Adds moving files from Uncontrolled Changelist to Changelist.
#rb Sebastien.Lussier
#preflight 609c2b365b35c60001e51d6c

[CL 16306199 by luc eygasier in ue5-main branch]
2021-05-12 17:06:06 -04:00
luc eygasier
9787a46325 Adds Base for Uncontrolled Changelist module.
#rb Sebastien.Lussier

#changelist validated

[CL 16224279 by luc eygasier in ue5-main branch]
2021-05-06 14:40:16 -04:00
aurel cordonnier
50944fd712 Merge UE5/RES @ 16162155 to UE5/Main
This represents UE4/Main @ 16130047 and Dev-PerfTest @ 16126156

[CL 16163576 by aurel cordonnier in ue5-main branch]
2021-04-29 19:32:06 -04:00
Luc Eygasier
0719865734 Fixes temporary CL left being when submitting default changelist.
Changing CL description just before submitting if needed, only if it is not the default CL.
Restore previous changelist description (before tag), in case the submit failed.

#rb Sebastien.Lussier, Julien.LHeureux
#jira UE-114188, UETOOL-3408
#changelist validated

[CL 16113557 by Luc Eygasier in ue5-main branch]
2021-04-26 09:23:26 -04:00
daren cheng
21da590afc Remove UE4 references in source control, AssetTools, Persona
#jira UE-111057, UE-111061, UE-111065, UE-111449, UE-111508
#robomerge Release-5.0-EarlyAccess
#rb trivial
#preflight 605ce8ea5e87c40001cb39e9

[CL 15834507 by daren cheng in ue5-main branch]
2021-03-25 18:44:53 -04:00
julien lheureux
e1004780ae Added timer on changelist refresh operation
Added Move files operation on files in changelist dialog (incl. move to new)
Added new changelist button in toolbar
Added cancellable "path beautification" when we have deleted/shelved files with no matching file, until we make it lazy and/or batched

#rb sebastien.lussier

[CL 15797238 by julien lheureux in ue5-main branch]
2021-03-24 08:29:57 -04:00
Sebastien Lussier
3901276790 WP HLODBuilder - Fix error when there's no files to mark for add
* P4 SCC would give an "invalid syntax" error as the p4 command was ill formed
* Added early exits in USourceControlHelpers operations that take an array of files
#robomerge Release-5.0-EarlyAccess
#rb patrick.enfedaque

[CL 15727461 by Sebastien Lussier in ue5-main branch]
2021-03-17 14:01:05 -04:00
julien lheureux
aa5b17da40 Fix "shelved files" from default changelist, now has the same behavior as in P4V.
Fix an issue where editing a changelist containing shelved files would fail silently.

#rb sebastien.lussier
#jira UE-107676

[CL 15359009 by julien lheureux in ue5-main branch]
2021-02-08 15:32:48 -04:00
julien lheureux
a460459eed Added possibility to get asset data from history, with a max fetch size (until we have a better solution)
Changed the way we associate shelved files with their local filename to facilitate mapping (perforce operations)
Implemented what was needed on the SCC side to support diff against shelve
Improved way we display object names for deleted & shelved files

#rb sebastien.lussier

[CL 15356101 by julien lheureux in ue5-main branch]
2021-02-08 09:36:20 -04:00
julien lheureux
202e872b4c Improved behavior of changelist operations on default changelist - edit & submit now work as intended.
Fixed an issue when trying to delete the default changelist which triggered a disconnection from the source control provider.
Improved some UI in the changelist context menu to clarify what is available or not.

#rb sebastien.lussier

[CL 15222160 by julien lheureux in ue5-main branch]
2021-01-27 16:11:25 -04:00
julien lheureux
108dfb8d7e Added support for shelved files in changelist, including shelve, unshelve and delete shelve operations.
Added update state for reopen operation as well.

#rb sebastien.lussier

[CL 15207112 by julien lheureux in ue5-main branch]
2021-01-26 09:19:24 -04:00
Matt Kuhlenschmidt
22268eca5f Source control dialog cleanup and reskin
[CL 15178205 by Matt Kuhlenschmidt in ue5-main branch]
2021-01-25 11:45:57 -04:00
Marc Audy
bc88b73a29 Merge Release-Engine-Staging to Main @ CL# 15151250
Represents UE4/Main @ 15133763

[CL 15158774 by Marc Audy in ue5-main branch]
2021-01-21 16:22:06 -04:00
julien lheureux
f3a1f5e632 Added confirmation on submit/revert changelists
Fixed an issue in the get pending changelists when there is only the default changelist present

[CL 15144321 by julien lheureux in ue5-main branch]
2021-01-20 09:51:23 -04:00
julien lheureux
8d3734f953 Added contextual menu options for file actions (diff agains depot, show history, locate file)
Better cleanup in perforce revert operation
Made revert work on changelists
Fixed issue where no changelists would be displayed if the default changelist was empty.

#rb sebastien.lussier

[CL 15138037 by julien lheureux in ue5-main branch]
2021-01-19 14:50:23 -04:00
julien lheureux
bf53b31450 Small improvements in the changelists
- Update UI for revert unchanged
- Update UI for submit CL

[CL 15132299 by julien lheureux in ue5-main branch]
2021-01-18 15:59:00 -04:00
Sebastien Lussier
58bdbc57ae Changelist window - Drag & drop support
#rb julien.lheureux

[CL 15132088 by Sebastien Lussier in ue5-main branch]
2021-01-18 15:31:14 -04:00
julien lheureux
2bb7495a45 - Added new, delete, edit changelist commands
- Added revert unchanged on changelists & files
- Added changelist parameter to the Execute method of ISourceControlProvider (& updated all derived classes)
- Fixed style problem in the Perforce settings dialog

#rb sebastien.lussier

[CL 15128504 by julien lheureux in ue5-main branch]
2021-01-18 09:42:33 -04:00
Matt Kuhlenschmidt
c13ac505b2 Updated source control icons
Source control providers now require an FSlateIcon and implementation of GetIcon instead of overriding mutliple functions to do the same thing. Fixed up all known source control providers.

#jira UETOOL-2812

[CL 15045642 by Matt Kuhlenschmidt in ue5-main branch]
2021-01-11 20:50:19 -04:00
Sebastien Lussier
6be153a555 Added initial support for changelists to the source control providers
#rb julien.lheureux

[CL 15039900 by Sebastien Lussier in ue5-main branch]
2021-01-11 14:32:27 -04:00