#rb PJ.Kack
#rnx
- Bug was intorduced in CL 26952096
- EConnectionOptions::WorkspaceOptional means we should not test if a workspace is valid but if one is provided it should still be used but in the above change EnsureValidConnection was changed and this resulted in the code discarding the workspace entirely if that option was used.
- If that option is used we just pass the input workspace name (if there is one) to the output structure and trust that the caller knows what they are doing.
[CL 27953007 by paul chipchase in ue5-main branch]
#rb Per.Larsson
### ISourceControlProvider
- Add a new ISourceControlProvider::Init overload that returns a struct (FInitResult) and takes a bitfield of flags (EInitFlags) so that we can more easily extend the initialization in future and return things to the caller.
- If a provider does not implement the new overload we fall-back to the original. This will be removed once all providers support the new path.
### PerforceSourceControlProvider
- Support the new init options via FPerforceConnection::EnsureValidConnection and update places that call it.
### FPerforceConnection
- Update ::AutoDetectWorkspace to return errors to the caller rather than handle its own logging.
- ::TestLoginConnection and ::TestClientConnection no longer calls FPerforceSourceControlProvider::SetLastErrors, this will be done at a higher level.
- ::AutoDetectWorkspace still does its own logging which will be fixed in a future update, it does however return its errors to the caller.
- Split the implementation of ::EnsureValidConnection to a stand alone internal function, the original function now handles and consolidates error handling.
-- Changed the logic to early out of failure rather than constantly checking a boolean all the way down.
-- Tried to remove the need for FPerforceSourceControlProvider to be passed in but a few places still require it.
-- Fixed our handling of the P4PORT value so that we can at least report problems if the address uses unicode characters. I have not yet tested if we can actually connect to such an address. We no longer use the servers unicode setting to decide the port strings encoding as it is not affected by the server settings.
-- Each error encountered should now record a localized error that we expect the user to be able to react to, then an array of errors from the API itself.
-- Once the internal code has run we will do a pass on all errors (if any) and strip any whitespace at the end (p4 tends to end error messages with newline characters) and then add a final entry to the additional errors detailing the settings at the point of failure. This was mostly being done before but is now enforced for every error.
-- No longer log the ticket, although the workflow to allow the user to supply one is not common we still probably don't want to save that to log files.
[CL 26952104 by paul chipchase in ue5-main branch]
Rewrite loop to be clear that the primary cursor is over changelists and the secondary cursor is over files.
#rb juan.legaz
[CL 26937944 by robert millar in ue5-main branch]
Speeds up query from 20+s to around 1.5s in an example workspace with 54 changelists.
#rb brooke.hubert
[CL 26294455 by robert millar in ue5-main branch]
#rb Wouter.Burgers
#rnx
### Bug Fix
- In CL 24941987 FPerforceGetFileWorker::Execute was modified to remove the perforce connection being created as that connection was not used and FPerforceSourceControlRevision::Get would create a second connection to be used.
- Removing this connection has an unintended knock on effect in that the command passed to the worker was never marked as having a successful server connection. So next tick the source control provider would check the now completed command, see that the connection was not a success (even though the command returned a success) and mark the connection to the server as broken, preventing future commands from working.
- Over the last year or so we have tried to move the code away from these sort of non-obvious side effects but there is a lot of work to do still.
- For now it is safest to add the connection back to FPerforceGetFileWorker::Execute but also add an overload to FPerforceSourceControlRevision::Get that allows us to pass in the connection to be used, to avoid the original problem of creating two connections as connection creation is super slow and can be costly on the server.
### Additional Changes
- There was no reason to allocate the FPerforceSourceControlRevision in FPerforceGetFileWorker::Execute on the heap as it is used immediately then deleted. We might as well just create it on the stack.
- Changed some code logic to early out rather than having long conditional scopes.
- The input parameters for FGetFile are still a bit odd (no revision == #0, revision -1 == #head etc) but leaving that alone for now until we merge FGetFile and FDownloadFiles to eliminate the duplicate code functionality.
[CL 25867524 by paul chipchase in ue5-main branch]
* Especially slow when large numbers of files are checked out (in the 25k+ range)
* Existing algorithm scales cubically
* Optimization: Changed to take advantage of the fact that filenames are already in a map, so a cheaper lookup to check if file in changelist is part of the to-be-deleted set
* Benchmark for this change is a map with ~32k empty actors in it. Source control enabled and using world partition (and thus One File Per Actor). It is important to check out all __ExternalActors__ files into default changelist and have the "View changes" window open.
- Delete N actors
- Save the level and measure time
Before:
100 actors : ~20s
200 actors : ~1m 20s
300 actors : ~2m 40s
500 actors : ~7m 20s
After:
100 actors : ~6s
200 actors : ~14s
500 actors : ~25s
There is plenty of room for more optimization here.
#jira UE-187093
#rb Brooke.Hubert
#preflight none
[CL 25652227 by logan buchy in ue5-main branch]
Added GetArrayHash() for hashing arrays by their contents.
Added a new pair of keyfuncs for TSets and TMaps which allow TCHAR* keys (or TCHAR* values passed to *ByHash functions) to be hashed by FCrc::Strihash_DEPRECATED().
#rb devin.doucette
#preflight 64708e7c296b2b37c6fd894a
[CL 25647216 by steve robb in ue5-main branch]
* Especially slow when large numbers of files are checked out (in the 25k+ range)
* Existing algorithm scales cubically
* Optimization #1: Changed to take advantage of the fact that filenames are already in a map, so a cheaper lookup to check if file in changelist is part of the to-be-deleted set
* Optimization #2: Another optimization takes advantage of the fact that it is typical the changelist to update is often the one in the to be deleted set. This is not going to be true for all workflows but helpful anyways.
* Benchmark shows deleting 100 actors from a level with 25k one file per actors checked out in default changelist takes the time to complete the operation from 12s to ~200us. Without optimization #2, this takes about 2s to complete.
#rb Brooke.Hubert
#preflight none
[CL 25604910 by logan buchy in ue5-main branch]
+ Expand source control menu context with selected changelist,
+ Expose information about if changelist is default and its source control specific identifier,
#rb Patrick.Enfedaque, Patrick.Laflamme, zach.rammell
#preflight skip
#p4v-cherrypick 25526575
#preflight 64665919b91ab13b09c2089c
[CL 25528171 by jordan hoffmann in ue5-main branch]
#rb none
#jira UE-183529
#rnx
#preflight 643fc10ba35280ed4f6a5590
- If p4 print is run on a path for a depot that either does not exist on the server or cannot be seen due to permissions then the server will return "-must refer to client" along with the name of the current client spec. This can be quite misleading since p4 print does not actually need a client.
-- To improve things for the user we can replace the error message provided by the p4 server with "no such depot"
[CL 25103494 by paul chipchase in ue5-main branch]
#rb none
#jira UE-183529
#rnx
#preflight 643e6671b91c130758304d30
- Added code documentation
- Renamed ::AddFileData to ::__Internal_AddFileData and documented that it is for internal use in the source control api. This is a standard problem with our operations being both input and output structures and needs a better solution.
- Moved ::GetFileData to the cpp to reduce the amount of code in the header file.
[CL 25083228 by paul chipchase in ue5-main branch]
- Failed if user had multiple p4 tickets
- Failed if default p4 username didn't match the provided username in UE
#jira UE-181982
#rb paul.chipchase
#preflight 643061621d61ecec3b63c465
[CL 24970980 by jordan hoffmann in ue5-main branch]