Class ClientMerge
java.lang.Object
com.perforce.p4java.impl.mapbased.rpc.func.client.ClientMerge
Support methods for the RPC merge protocols. Will grow as we implement more types
of merge; current version is very bare bones and oriented solely at non-interactive
three-way merges of text files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPossible choices available to a merge / resolve; should be fairly self-explanatory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclientCloseMerge(RpcConnection rpcConnection, CommandEnv cmdEnv, Map<String, Object> resultsMap) Close the merge write (above) and act on the results.clientOpenMerge3(RpcConnection rpcConnection, CommandEnv cmdEnv, Map<String, Object> resultsMap, boolean twoWayMerge) Implement a non-interactive version of the three-way client-side merge.clientWriteMerge(RpcConnection rpcConnection, CommandEnv cmdEnv, Map<String, Object> resultsMap) Write merge data to the client if necessary.
-
Field Details
-
MARKER_ORIGINAL
- See Also:
-
MARKER_THEIRS
- See Also:
-
MARKER_YOURS
- See Also:
-
MARKER_BOTH
- See Also:
-
MARKER_END
- See Also:
-
DEFAULT_TMPFILE_PFX
- See Also:
-
DEFAULT_TMPFILE_SFX
- See Also:
-
SYSTEM_TMPDIR_PROPS_KEY
- See Also:
-
SYSTEM_TMPDIR_DEFAULT
- See Also:
-
TRACE_PREFIX
- See Also:
-
MERGE_STATE_KEY
- See Also:
-
MERGE_BASE_TMP_FILE_KEY
- See Also:
-
MERGE_BASE_TMP_STREAM_KEY
- See Also:
-
MERGE_THEIRS_TMP_FILE_KEY
- See Also:
-
MERGE_THEIRS_TMP_STREAM_KEY
- See Also:
-
MERGE_YOURS_TMP_FILE_KEY
- See Also:
-
MERGE_YOURS_TMP_STREAM_KEY
- See Also:
-
-
Constructor Details
-
ClientMerge
-
-
Method Details
-
clientOpenMerge3
protected RpcPacketDispatcher.RpcPacketDispatcherResult clientOpenMerge3(RpcConnection rpcConnection, CommandEnv cmdEnv, Map<String, Object> resultsMap, boolean twoWayMerge) throws ConnectionExceptionImplement a non-interactive version of the three-way client-side merge.- Parameters:
rpcConnection- rpcConnectioncmdEnv- cmdEnvresultsMap- resultsMaptwoWayMerge- twoWayMerge- Returns:
- RpcPacketDispatcherResult
- Throws:
ConnectionException- on error
-
clientWriteMerge
protected RpcPacketDispatcher.RpcPacketDispatcherResult clientWriteMerge(RpcConnection rpcConnection, CommandEnv cmdEnv, Map<String, Object> resultsMap) throws ConnectionExceptionWrite merge data to the client if necessary.For the external stream merge case, this is a no op, but for the normal three-way merge case, we not only need to write the relevant files, but we also need to keep track of the differences so we can determine whether an automatic and / or safe merge is even possible. This determination is done in clientCloseMerge using chunk difference counts as supplied by the server in the bits parameter.
For the two-way merge, all we really need to do is write the "their" file and keep digesting under the covers...
- Parameters:
rpcConnection- rpcConnectioncmdEnv- cmdEnvresultsMap- resultsMap- Returns:
- RpcPacketDispatcherResult
- Throws:
ConnectionException- on error
-
clientCloseMerge
protected RpcPacketDispatcher.RpcPacketDispatcherResult clientCloseMerge(RpcConnection rpcConnection, CommandEnv cmdEnv, Map<String, Object> resultsMap) throws ConnectionExceptionClose the merge write (above) and act on the results. The actions needed here depend on whether we're doing a merge from external stream or a safe auto merge.- Parameters:
rpcConnection- rpcConnectioncmdEnv- cmdEnvresultsMap- resultsMap- Returns:
- RpcPacketDispatcherResult
- Throws:
ConnectionException- on error
-