com.perforce.p4java.impl.mapbased.rpc.func.client
Class ClientMergeState
java.lang.Object
com.perforce.p4java.impl.mapbased.rpc.func.client.ClientMergeState
public class ClientMergeState
- extends Object
Helper class for carrying useful merge state around during the various merge
operations defined in ClientMerge. Modeled somewhat on the C++ API's
clientmerge3.cc object, but tuned more to our more limited purposes.
Also includes support for two-way merge, but this is currently less-well
exercised and tested.
Note: not particularly thread-safe, nor intended to be.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TRACE_PREFIX
public static final String TRACE_PREFIX
- See Also:
- Constant Field Values
DEFAULT_TMPFILE_PFX
public static final String DEFAULT_TMPFILE_PFX
- See Also:
- Constant Field Values
DEFAULT_TMPFILE_SFX
public static final String DEFAULT_TMPFILE_SFX
- See Also:
- Constant Field Values
twoWayMerge
protected boolean twoWayMerge
baseDigest
protected String baseDigest
yourDigest
protected String yourDigest
theirDigest
protected String theirDigest
ClientMergeState
protected ClientMergeState(String clientPath,
boolean externalStreamMerge,
RpcPerforceFileType clientType,
RpcPerforceFileType resultType,
String tmpDir,
Charset charset)
- Parameters:
externalStreamMerge
- set true if this is a merge from an external streamtmpDir
- the name of a suitable directory for creating temporary files in
openMergeFiles
protected void openMergeFiles(boolean isUnicodeServer)
throws IOException
- Open and / or create the necessary files for this merge. The "yours"
file is the original client file, and doesn't need opening. The rest
are opened as tmp files in the system tmp directory; this isn't exactly
the same as the C++ API's behaviour (which opens them in the target directory)
but it should be fairly safe.
Note that the file types for each file are copied from the C++ API usage;
I'm not entirely sure this arrangement always make sense...
- Throws:
IOException
- if there's been a problem opening any of the files.
writeMarker
protected void writeMarker(String markerString)
throws IOException
- Throws:
IOException
writeBaseChunk
protected void writeBaseChunk(byte[] bytes)
throws IOException
- Throws:
IOException
writeTheirChunk
protected void writeTheirChunk(byte[] bytes)
throws IOException
- Throws:
IOException
writeYourChunk
protected void writeYourChunk(byte[] bytes)
throws IOException
- Throws:
IOException
writeResultChunk
protected void writeResultChunk(byte[] bytes)
throws IOException
- Throws:
IOException
finishMerge
protected boolean finishMerge(ClientMerge.ResolveChoice choice)
throws IOException
- Throws:
IOException
getMergeDigestString
protected String getMergeDigestString()
getTheirDigestString
protected String getTheirDigestString()
getYourDigestString
protected String getYourDigestString()
incrYourChunks
protected int incrYourChunks()
theirYourChunks
protected int theirYourChunks()
incrConflictChunks
protected int incrConflictChunks()
incrTheirChunks
protected int incrTheirChunks()
incrBothChunks
protected int incrBothChunks()
getClientPath
protected String getClientPath()
setClientPath
protected void setClientPath(String clientPath)
getBaseName
protected String getBaseName()
setBaseName
protected void setBaseName(String baseName)
getTheirName
protected String getTheirName()
setTheirName
protected void setTheirName(String theirName)
getYourName
protected String getYourName()
setYourName
protected void setYourName(String yourName)
getBaseTmpFilename
protected String getBaseTmpFilename()
setBaseTmpFilename
protected void setBaseTmpFilename(String baseTmpFilename)
getTheirTmpFilename
protected String getTheirTmpFilename()
setTheirTmpFilename
protected void setTheirTmpFilename(String theirTmpFilename)
getYourTmpFilename
protected String getYourTmpFilename()
setYourTmpFilename
protected void setYourTmpFilename(String yourTmpFilename)
getBaseTmpFile
protected RpcPerforceFile getBaseTmpFile()
setBaseTmpFile
protected void setBaseTmpFile(RpcPerforceFile baseTmpFile)
getTheirTmpFile
protected RpcPerforceFile getTheirTmpFile()
setTheirTmpFile
protected void setTheirTmpFile(RpcPerforceFile theirTmpFile)
getYourTmpFile
protected RpcPerforceFile getYourTmpFile()
setYourTmpFile
protected void setYourTmpFile(RpcPerforceFile yourTmpFile)
getBaseTmpFileStream
protected RpcOutputStream getBaseTmpFileStream()
setBaseTmpFileStream
protected void setBaseTmpFileStream(RpcOutputStream baseTmpFileStream)
getYourTmpFileStream
protected RpcOutputStream getYourTmpFileStream()
setYourTmpFileStream
protected void setYourTmpFileStream(RpcOutputStream yourTmpFileStream)
getTheirTmpFileStream
protected RpcOutputStream getTheirTmpFileStream()
setTheirTmpFileStream
protected void setTheirTmpFileStream(RpcOutputStream theirTmpFileStream)
getYourChunks
protected int getYourChunks()
setYourChunks
protected void setYourChunks(int yourChunks)
getTheirChunks
protected int getTheirChunks()
setTheirChunks
protected void setTheirChunks(int theirChunks)
getConflictChunks
protected int getConflictChunks()
setConflictChunks
protected void setConflictChunks(int conflictChunks)
getBothChunks
protected int getBothChunks()
setBothChunks
protected void setBothChunks(int bothChunks)
getBits
protected int getBits()
setBits
protected void setBits(int bits)
getOldBits
protected int getOldBits()
setOldBits
protected void setOldBits(int oldBits)
getTmpDir
protected String getTmpDir()
setTmpDir
protected void setTmpDir(String tmpDir)
isExternalStreamMerge
protected boolean isExternalStreamMerge()
setExternalStreamMerge
protected void setExternalStreamMerge(boolean externalStreamMerge)
getExternalTmpFilename
protected String getExternalTmpFilename()
setExternalTmpFilename
protected void setExternalTmpFilename(String externalTmpFilename)
getResultTmpFile
protected RpcPerforceFile getResultTmpFile()
setResultTmpFile
protected void setResultTmpFile(RpcPerforceFile resultTmpFile)
getResultTmpFileStream
protected RpcOutputStream getResultTmpFileStream()
setResultTmpFileStream
protected void setResultTmpFileStream(RpcOutputStream resultTmpFileStream)
isSafeMerge
protected boolean isSafeMerge()
setSafeMerge
protected void setSafeMerge(boolean safeMerge)
isAutoMerge
protected boolean isAutoMerge()
setAutoMerge
protected void setAutoMerge(boolean autoMerge)
isShowAll
protected boolean isShowAll()
setShowAll
protected void setShowAll(boolean showAll)
isTwoWayMerge
protected boolean isTwoWayMerge()
setTwoWayMerge
protected void setTwoWayMerge(boolean twoWayMerge)
getBaseDigest
protected String getBaseDigest()
setBaseDigest
protected void setBaseDigest(String baseDigest)
getYourDigest
protected String getYourDigest()
setYourDigest
protected void setYourDigest(String yourDigest)
getTheirDigest
protected String getTheirDigest()
setTheirDigest
protected void setTheirDigest(String theirDigest)
Copyright © 2015 Perforce Software. All Rights Reserved.