Commit Graph

40 Commits

Author SHA1 Message Date
Ben Marsh
508c144999 Horde: Last batch (hopefully) of static analysis fixes/suppressions.
#preflight 623e144c8073508cfc117a87

[CL 19517822 by Ben Marsh in ue5-main branch]
2022-03-25 15:35:47 -04:00
Ben Marsh
892805279c P4: Add support for intercepting I/O through native Perforce library. This allows streaming sync data directly into memory, avoiding any writes to disk.
#preflight 620a741d17632e948459cb9d

[CL 18979717 by Ben Marsh in ue5-main branch]
2022-02-14 10:37:38 -05:00
Ben Marsh
40c9e7cb50 Horde: Fix typo.
#preflight none

[CL 18623460 by Ben Marsh in ue5-main branch]
2022-01-14 16:23:06 -05:00
Ben Marsh
1ea7fefd32 Horde: If a call to p4 login doesn't return a proper record, call p4 login -s to get one.
#preflight none

[CL 18623341 by Ben Marsh in ue5-main branch]
2022-01-14 16:17:31 -05:00
Ben Marsh
a40c4c2c8b UGS: Support for running UGS CLI on Mac.
#preflight none

[CL 18554839 by Ben Marsh in ue5-main branch]
2022-01-08 15:04:19 -05:00
Ben Marsh
7a9e8c8b5c UGS: Significant refactor of UGS internals.
- Now uses the custom C++ Perforce library developed for Horde. This removes dependencies on an installed P4.EXE tool, improves performance, and paves the way to cross-platform support via command line invocations.
- As part of the migration to the new Perforce library, the codebase now uses async/await extensively instead of background threads, and supports a proper cancellation path rather than aborting threads.
- ILogger is now used for writing log files.
- Started converting to use of nullable annotations.

#preflight none

[CL 18511154 by Ben Marsh in ue5-main branch]
2022-01-04 14:03:17 -05:00
Ben Marsh
e7ab127649 [CS] Various improvements to Perforce library.
- Removed functionality to set environment variables through the IPerforceConnection object. This is now handled via PerforceEnvironment.
- Added support for logging in using the native Perforce connection implementation.
- Started migrating methods that return a list of responses to return an IAsyncEnumerable instead. This makes it much easier to perform stream processing on requests that return a lot of data.
- Added the "p4 depot" command.
- Added the "p4 have" command.
- Added the "p4 opened" command.
- Added the "p4 stream" command.
- Added the "p4 users" command.
- Added support for printing files to a temporary file, and for p4 print commands returning metadata along with the payload in its response.
- Fixed stream corruption using native Perforce library if a record did not completely fit within the output buffer.

#preflight none

[CL 18504069 by Ben Marsh in ue5-main branch]
2022-01-03 17:18:56 -05:00
Ben Marsh
1f185de5a4 Combine interface for creating native and external Perforce client connections.
- PerforceEnvironment class now allows querying the state of Perforce environment variables in a client agnostic way. (Supports system environment variables on Mac/Linux, and registry on Win32. Also reads settings from any P4ENVIRO file, and P4CONFIG files when initialized with a directory.)
- Connection settings are now stored in a PerforceSettings object, with a read-only IPerforceSettings interface. Both clients can be initialized through the same parameter block.
- A connection can be created using the PerforceConnection.CreateAsync() method. Specifying the IPerforceSettings.PreferNativeClient will create a NativePerforceConnection implementation where possible.

[CL 18464429 by Ben Marsh in ue5-main branch]
2021-12-14 21:31:40 -05:00
Ben Marsh
72dbf9aa4e Enable code analysis (and fix warnings) for EpicGames.Perforce.
#preflight 61b7b75dc65177a67488ca5e

[CL 18449150 by Ben Marsh in ue5-main branch]
2021-12-13 16:50:25 -05:00
Ben Marsh
08007defcb UAT: Add extension methods for the "p4 files" command to IPerforceConnection.
[CL 18440749 by Ben Marsh in ue5-main branch]
2021-12-12 12:43:30 -05:00
Maxime Mercier
1a49c53b87 New perforce tools
Data tools:
* Convert data to local writable -> Convert All data in changelist or all selected data files to local writable

Unshelving tools:
* Unshelve to current revision -> Remembers revision all files you are about to unshelve and if the revision is older, will sync to saved revision
* Unshelve and make data writable -> Unshelve changelist but for data will make them writable locally

#jira none
#review-17681604
#rb Andy.Firth Brandon.Dawson
#preflight skip

#robomerge 5.0
#robomerge FnMain

[CL 18039467 by Maxime Mercier in ue5-main branch]
2021-11-03 15:49:48 -04:00
Ben Marsh
2d70fb8adc Horde: Reduce memory usage when querying workspace state (pt 1)
* CbWriter instances may now be cleared, and can cache allocated buffers between uses.
* Records may now be returned using IAsyncEnumerable<T> allowing them to be processed as they are received, and removing the need to allocate large numbers of temporary objects.

[CL 17599803 by Ben Marsh in ue5-main branch]
2021-09-22 16:10:08 -04:00
Ben Marsh
aeaac2616d Horde: Improve error messages from Perforce commands.
[CL 17570645 by Ben Marsh in ue5-main branch]
2021-09-20 10:35:13 -04:00
Ben Marsh
3b17bd92d0 Horde: Add support for the "p4 dirs" command.
This requires special handling for the native Perforce connection, since it returns information as message records that the client formats as strings through an "Error" object. To work around this, the C++ library converts such messages into stat records that are more easily parsed by C# code.

[CL 17526529 by Ben Marsh in ue5-main branch]
2021-09-15 16:49:30 -04:00
Ryan Hummer
49e8935e90 Fixing Perforce Fetching user info failing.
user command must have a space after the -o before the user name, restore the space and quoting the user name

#jira none

[CL 17389981 by Ryan Hummer in ue5-main branch]
2021-09-01 13:57:32 -04:00
Ben Marsh
11dabd8bc8 EpicGames.Perforce: Fix infinite loop in CommandAsync().
[CL 17386458 by Ben Marsh in ue5-main branch]
2021-09-01 10:31:15 -04:00
Ben Marsh
501bf53ae6 EpicGames.Perforce Fix argument for -x when using child process. Delegate to the connection implementation to write arguments to a response file.
[CL 17386176 by Ben Marsh in ue5-main branch]
2021-09-01 10:06:19 -04:00
Ben Marsh
390c78654c Add a native implementation of IPerforceConnection, which uses the Perforce C++ API (via a DLL called EpicGames.Perforce.Native) to output records to a buffer shared with managed code (which is double-buffered with the processing thread in managed code). Interaction with the API is lightweight and done on a background thread, with an async API overlaid on top. Prebuilt binaries for the native component are currently tested on Windows and Linux.
Performance has been tested against the P4 .NET API and the command line client by performing a fstat of non-deleted files in //UE5/Main.

EpicGames.Perforce (this library): 47s
Command line client piping to file: 59s
P4 .NET API: ~40 minutes

[CL 17347502 by Ben Marsh in ue5-main branch]
2021-08-29 16:35:57 -04:00
Ben Marsh
d0a856c8b7 P4: Add an interface for Perforce responses, and move the record deserialization logic into extension methods on it.
[CL 17335637 by Ben Marsh in ue5-main branch]
2021-08-27 12:19:41 -04:00
Ben Marsh
a05d88f335 Quality of life improvements for EpicGames.Perforce.
* Introduce a new FileSpecList class which supports implicit conversion from a single string and arrays/lists of strings.
* Make the cancellation token argument to all commands optional.

[CL 17335316 by Ben Marsh in ue5-main branch]
2021-08-27 11:43:35 -04:00
Ben Marsh
d98420677a P4: Specify command arguments as a list rather than a concatenated string, for future compatibility with C++ library.
[CL 17335163 by Ben Marsh in ue5-main branch]
2021-08-27 11:21:50 -04:00
Ben Marsh
24b7152d41 Introduce an interface for Perforce connections in C#.
[CL 17334845 by Ben Marsh in ue5-main branch]
2021-08-27 10:23:34 -04:00
Ben Marsh
db9e56c5ca Move functionality on PerforceConnection to extension methods, so we can have different implementations of the core connection handler.
[CL 17334540 by Ben Marsh in ue5-main branch]
2021-08-27 09:19:56 -04:00
andrew firth
83fe64ea47 [P4VUtils] - add Fast reconcile options for code + all - performs a reconcile on files in P4 that are writeable but NOT checked out
#review-17096558 @Ben.Marsh @Brandon.Dawnson
#rb Ben.Marsh

[CL 17096670 by andrew firth in ue5-main branch]
2021-08-07 22:49:04 -04:00
aurel cordonnier
ab8e255930 P4 Blame tool for P4V (requires input of the line number)
#rb marc.audy, ben.marsh
#jira none

[CL 16852242 by aurel cordonnier in ue5-main branch]
2021-07-14 13:23:58 -04:00