Commit Graph

223 Commits

Author SHA1 Message Date
paul chipchase
5f0e71408d Remove unused perforce connection from FPerforceGetFileWorker
#rb Wouter.Burgers
#jira UE-173524
#rnx
#preflight 642e806dda7f9583702d81e4

- FPerforceGetFileWorker::Execute doesn't actually do any perforce work directly, it creates a new FPerforceSourceControlRevision and lets that object do the perforce work. So the connection that FPerforceGetFileWorker was making was never used and FPerforceSourceControlRevision would then create a second connection.

[CL 24941987 by paul chipchase in ue5-main branch]
2023-04-06 04:29:28 -04:00
logan buchy
a67304583f Add CVar to change perforce idle connection timeout
* Aids in testing this feature
* Use CMD:  SourceControl.Perforce.IdleConnectionDisconnectSeconds = <seconds>

#jira UE-173884
#rb johan.duparc
#preflight 642af82e6a37fb35e9bd0e42

[CL 24905944 by logan buchy in ue5-main branch]
2023-04-03 22:30:03 -04:00
marco anastasi
f6978a065c Created new Source Control feature flag UsesSnapshots() to solve inconsistency in use of UsesChangelists() and UsesFileRevisions() causing issues for git Source Control Provider
* Option to check in an asset from the Content Browser Source Control Context Menu is now enabled if the SCC does not use Snapshots instead of if it uses File Revisions
* Option to check in an asset from the Scene Outliner Source Control Context Menu is now enabled if the SCC does not use Snapshots instead of if it uses File Revisions
* Ability to uncheck files in the Submit Files Window is now enabled if the SCC does not use Snapshots instead of if it uses File Revisions
* Option to revert the writable flag on an asset in the Content Browser Source Control Context Menu is now enabled if the SCC uses checkout instead of if it uses File Revisions (like the 'Make Writable' option)

#jira UCS-6630
#rb brooke.hubert, wouter.burgers
#lockdown jeanmichel.dignard
#preflight 640e6b41482188d710ff8316

[CL 24724061 by marco anastasi in ue5-main branch]
2023-03-20 17:20:41 -04:00
logan buchy
1a734acb83 Add an idle timeout on perforce persistent connections
A connection to the perforce server can consume a large amount of memory on the server.  This change is to add a timeout to any persistent connections
in order to conserve this memory.
To do so, a connection tracks the platform time of the last successful communication.  The provider checks the persistent connection it has each frame and if
the last successful connect exceeded the timeout, then the connection is closed.  A new persistent connection will be established next time one is required.

The timeout is set as a hardcoded value for now.

#jira UE-173884
#rb Ronald.Koppers
#preflight 64122ee5af3fc352929f8e3b

[CL 24665411 by logan buchy in ue5-main branch]
2023-03-15 19:45:07 -04:00
Johan Duparc
3c59cba430 PerforceSourceControl: Use standard logging instead of an ensure to report unhandled file state
#jira UE-176058
#rb Brooke.Hubert
#preflight 641068d470639dfc94536c02

[CL 24633634 by Johan Duparc in ue5-main branch]
2023-03-14 08:36:48 -04:00
pj kack
4023ee1dde UnrealPak: Optimizations for small workloads.
Add -fastexit parameter to terminate process instead of shutting down engine.
Turn off build target features to build less code (total dll size reduced from 56 MB to 46 MB).
Disable external profiler supports (skips loading of some dlls).
Don't spawn any reserve workers (by adding a DefaultEngine.ini for UnrealPak).
Make UnrealPAk compile in Test config (by fixing compile error in PerforceConnection.cpp).

#rb carlmagnus.nordin
#rnx
#preflight 63e5eaf66473b534f14e377b

[CL 24118943 by pj kack in ue5-main branch]
2023-02-10 10:13:31 -05:00
wouter burgers
1d6ef4b2e3 SourceControl: Added CanExecuteOperation to ISourceControlProvider interface.
#preflight 63de1752fe33a06594fc2e02

[CL 24018386 by wouter burgers in ue5-main branch]
2023-02-04 10:54:03 -05:00
jordan hoffmann
c0d518be33 [Backout] - Reverted Changes to SPerforceSourceControlSettings made in CL23857698
#preflight trivial
#rb dan.oconnor

[CL 23984120 by jordan hoffmann in ue5-main branch]
2023-02-02 18:44:45 -05:00
paul chipchase
39f6471fad Fix the perforce source control api returning invalid file paths when the users client spec root ends with a '/'or '\'
#rb Brooke.Hubert, Patrick.Laflamme
#rnx
#preflight 63d7927df62671520156e69d

- CL 23859876 introduced optimizations that consider a filepath to be invalid if the path contains consecutive path separators (DirA//DirB for example instead of DirA/DirB) and although no issues were seen when testing we fairly quickly ran into a user facing errors when trying to submit work from the editor.
- The users client spec root had a '\' at the end of it where as most internal devs do not. This in turn caused problems when parsing file info from source control as the code was assuming that the client spec root had no trailing separator and was adding one.
- We now normalize the client spec root after we parse it via a call to FPaths::NormalizeDirectoryName which should enforce that the root path match all our usual expectations.

[CL 23945309 by paul chipchase in ue5-main branch]
2023-02-01 04:04:01 -05:00
henrik karlsson
5d182413f0 [Engine/Plugins]
* Added IWYUSupport.KeepAsIsForNow on a bunch of plugins that requires work to be able to run iwyu

#preflight skipped
#rb none

[CL 23898272 by henrik karlsson in ue5-main branch]
2023-01-28 03:18:29 -05:00
jordan hoffmann
890ebc2a44 [BugFix] Disabled ReviewChangelist tool when source control is inactive
also made SPerforceSourceControlSettings::GetPassword() fail silently when on a non-slate thread rather than asserting
#jira UE-169786
#jira UE-172421
#jira UE-173530
#rb none
#preflight 63d197fe45795e7d5c0a2ef2

[CL 23863403 by jordan hoffmann in ue5-main branch]
2023-01-25 20:42:28 -05:00
bob tellez
eec77c4bc0 #UE Remove some redundant messages from the DownloadFile p4 operation, similar to how other operations behave
[CL 23603094 by bob tellez in ue5-main branch]
2023-01-06 16:09:40 -05:00
paul chipchase
cffcf4bf46 Fix the perforce API reporting that files are not under source control when polled via the depot path.
#rb brooke.hubert
#jira UE-172649
#rnx
#preflight 63986274c16855964d9cfc76

- If we queried the state of a file using the depot path it would parse correctly but internally record the state as 'DontCare' meaning that it has no special state but the change in 23468037 causes files with that state to be classed as not under source control.
- The root problem that 23468037 was fixing was that when querying a file that does not exist (using client paths) we expect the file state to be set to 'NotInDepot' but for a file in a unit test this state was coming back as 'DontCare'. This was due to the imaginary file was being queried as a depot location (Engine root) where most users do not have permission to add things, so instead of an error message indicating that the file does not exist, the server was returning an error relating to permissions.
- We can fix this by checking for the permission error and adding that to the list of errors that result in us setting the 'NotInDepot' state. Which in turn allows us to remove the change from 23468037 that was blocking the depot path queries.
- There is an argument to be made that we should not allow file states to be queried via depot paths and doing so should raise an error. To allow that we would need to extend the source control api with a way to query files server state which would be out of scope for a release hot fix.

[CL 23531470 by paul chipchase in ue5-main branch]
2022-12-15 15:59:42 -05:00
stuart hill
d8b31f7ed0 Add a flag to the source control provider to tell us if 'uncontrolled' changelists are supported.
#rb Marco.Anastasi, zach.rammell
#prelight 6398633f8c5081ee9a275f20

[CL 23499875 by stuart hill in ue5-main branch]
2022-12-13 18:18:02 -05:00
brooke hubert
696920d4fd Fix source control automated tests that were failing
#Jira UE-172352
#preflight 63921eedbb6fefa472891573
#rb jamie.dale

[CL 23475330 by brooke hubert in ue5-main branch]
2022-12-11 23:10:18 -05:00
aditya ravichandran
28eccf9aa0 Revision Control Iconography Update:
Update the default set of revision control icons
Create FRevisionControlStyleManager to manage the currently active revision control style and add a default style that is used by all providers
#rb lauren.barnes, brooke.hubert
#preflight 639364ee67018b14b5fb9891

[CL 23466976 by aditya ravichandran in ue5-main branch]
2022-12-09 14:18:01 -05:00
aditya ravichandran
f8b7ee5555 Replace any instances of "Source Control" with "Revision Control" in text in the Editor
#rb JeanMichel.Dignard, Robb.Surridge
#preflight 637d180efa348e8480e8837e

[CL 23250808 by aditya ravichandran in ue5-main branch]
2022-11-23 11:57:50 -05:00
henrik karlsson
b5164ac775 Fixes to make modules compile with IWYU. We've added to IWYU toolchain so it compiles "orphaned" headers which does not have a owning cpp file. This identified lots of headers that couldn't be compiled by themselves (or if they were to included first)
Change consist of only forward declaration and additional includes

#preflight 63789c1de30d438849c48188
#rb none

[CL 23218412 by henrik karlsson in ue5-main branch]
2022-11-21 03:22:23 -05:00
paul chipchase
1a00222986 The perforce source control API can now issue a single p4 print command with multiple depot file paths as arguments rather than issuing a single p4 print command per file.
#rb PJ.Kack
#jira UE-167578
#rnx
#preflight 635bdddd5b54febd38b7efd0

- Clean up the source control backend by removing the older code path that was ifdefed out and clean up the new path.
- FPerforceConnection no longer takes a TOptional<FSharedBuffer> but takes an optional pointer to a TArray of FSharedBuffer. When gathering files this should return one FSharedBuffer per file requested.
-- It might make more sense to attach the FSharedBuffer to the FP4Record but that would require some bigger changes and would be better suited to being some follow on work. All the code is private in the module and not exposed so it is fairly safe and easy to do these refactors later.

- Replaced the TArray buffer for gathering files with a purpose built class FP4DepotFile.
- When issuing a p4 print command with multiple files we will get one call to ClientUser::OutputStat followed by calls to either ClientUser::OutputText or ClientUser::OutputBinary until all of the file has been delivered, then we will get another call to ClientUser::OutputStat for the next file and so on.
-- Note with binary files we seem to get one final call to ClientUser::OutputBinary with zero size, which I assume is supposed to signal the end of the transfer, text files do not get this, they seem to just stop.

[CL 22888671 by paul chipchase in ue5-main branch]
2022-11-01 15:10:19 -04:00
stuart hill
1fc502d9b1 Give the option to disable being able to diff files in the Source Control Submit Widget. To allow this, AllowsDiffAgainstDepot function should return false.
#preflight 6360fd498768c5532f5425f0
#rb Marco.Anastasi, Patrick.Laflamme

[CL 22888653 by stuart hill in ue5-main branch]
2022-11-01 15:09:57 -04:00
christian savoie
fd89edb9be Add access to local revision number for all source control systems.
Change perforce Revert option to be based on if an item is checked out or marked for add, rather than if it can be checked in.

#tests Used to implement source control menu refactor https://p4-swarm.epicgames.net/reviews/22528870

[CL 22863683 by christian savoie in ue5-main branch]
2022-10-31 11:08:06 -04:00
paul chipchase
d657c87f4d Prevent a slate assert if a perforce connection error is encountered when initializing VA source control connections from background threads.
#rb Sebastian.Nordgren
#rnx
#preflight 63581307d669d2aa7ec95866

- Added FTSMessageLog which is a thread safe version of FMessageLog with limited functionality. It can be used as a thread safe drop in replacement for code that only wants to send messages to the FMessageLog system.
- Somewhat experimental at the moment so it is being kept private in the perforce plugin where it is immediately needed.
- Thread safety is currently achieved by using the normal logging system if we detect that the messages are being added from background threads.
-- In future work this will be improved and we will marshal the messages to the GameThread.

[CL 22795873 by paul chipchase in ue5-main branch]
2022-10-26 18:17:21 -04:00
christian savoie
48b260a74e Fix Perforce Sync command to correctly use Revision value.
Add Revision and Force options to Plastic and Subversion.

#tests Used when implementing source control menu refactor  https://p4-swarm.epicgames.net/reviews/22528870, only tested perforce sync command.

[CL 22683432 by christian savoie in ue5-main branch]
2022-10-21 01:05:23 -04:00
patrick enfedaque
aa180f6f09 Fix not being able to revert Uncontrolled Changelist changes with files not at head revision. (files were forced synched to proper revision but would stay in the UC)
- Add flag to SourceControlOperation to test modified status against synched revision (p4 #have)
- Use this new flag when testing for modifications in UncontrolledChangelist

#jira UE-165558
#rb luc.eygasier
#preflight 633633b7936ff7e3dcda5f92

[CL 22271768 by patrick enfedaque in ue5-main branch]
2022-09-30 11:39:49 -04:00
marco anastasi
dd01cd42b5 Create shortcut buttons in Status Bar for Skein operations
#rb wouter.burgers, patrick.laflamme
#preflight 63301d3d665f6b8f7fab0066


RESOLUTION: Resolved conflict with IsAtLatestRevision() and GetNumLocalChanges()

[CL 22193646 by marco anastasi in ue5-main branch]
2022-09-26 16:32:49 -04:00