public class ClientMergeState
extends java.lang.Object
Note: not particularly thread-safe, nor intended to be.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
baseDigest |
static java.lang.String |
DEFAULT_TMPFILE_PFX |
static java.lang.String |
DEFAULT_TMPFILE_SFX |
static java.lang.String |
TRACE_PREFIX |
protected boolean |
twoWayMerge |
Modifier | Constructor and Description |
---|---|
protected |
ClientMergeState(java.lang.String clientPath,
boolean externalStreamMerge,
RpcPerforceFileType clientType,
ClientLineEnding clientLineEnding,
RpcPerforceFileType resultType,
ClientLineEnding resultLineEnding,
java.lang.String tmpDir,
java.nio.charset.Charset charset) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
finishMerge(ClientMerge.ResolveChoice choice) |
protected java.lang.String |
getBaseDigest() |
protected java.lang.String |
getBaseName() |
protected RpcPerforceFile |
getBaseTmpFile() |
protected java.lang.String |
getBaseTmpFilename() |
protected RpcOutputStream |
getBaseTmpFileStream() |
protected int |
getBits() |
protected int |
getBothChunks() |
protected java.lang.String |
getClientPath() |
protected int |
getConflictChunks() |
protected java.lang.String |
getExternalTmpFilename() |
protected java.lang.String |
getMergeDigestString() |
protected int |
getOldBits() |
protected RpcPerforceFile |
getResultTmpFile() |
protected RpcOutputStream |
getResultTmpFileStream() |
protected int |
getTheirChunks() |
protected java.lang.String |
getTheirDigestString() |
protected java.lang.String |
getTheirName() |
protected RpcPerforceFile |
getTheirTmpFile() |
protected java.lang.String |
getTheirTmpFilename() |
protected RpcOutputStream |
getTheirTmpFileStream() |
protected java.lang.String |
getTmpDir() |
protected int |
getYourChunks() |
protected java.lang.String |
getYourDigestString() |
protected java.lang.String |
getYourName() |
protected RpcPerforceFile |
getYourTmpFile() |
protected java.lang.String |
getYourTmpFilename() |
protected RpcOutputStream |
getYourTmpFileStream() |
protected int |
incrBothChunks() |
protected int |
incrConflictChunks() |
protected int |
incrTheirChunks() |
protected int |
incrYourChunks() |
protected boolean |
isAutoMerge() |
protected boolean |
isExternalStreamMerge() |
protected boolean |
isSafeMerge() |
protected boolean |
isShowAll() |
protected boolean |
isTwoWayMerge() |
protected void |
openMergeFiles(RpcConnection rpcConnection)
Open and / or create the necessary files for this merge.
|
protected void |
setAutoMerge(boolean autoMerge) |
protected void |
setBaseDigest(java.lang.String baseDigest) |
protected void |
setBaseName(java.lang.String baseName) |
protected void |
setBaseTmpFile(RpcPerforceFile baseTmpFile) |
protected void |
setBaseTmpFilename(java.lang.String baseTmpFilename) |
protected void |
setBaseTmpFileStream(RpcOutputStream baseTmpFileStream) |
protected void |
setBits(int bits) |
protected void |
setBothChunks(int bothChunks) |
protected void |
setClientPath(java.lang.String clientPath) |
protected void |
setConflictChunks(int conflictChunks) |
protected void |
setExternalStreamMerge(boolean externalStreamMerge) |
protected void |
setExternalTmpFilename(java.lang.String externalTmpFilename) |
protected void |
setOldBits(int oldBits) |
protected void |
setResultTmpFile(RpcPerforceFile resultTmpFile) |
protected void |
setResultTmpFileStream(RpcOutputStream resultTmpFileStream) |
protected void |
setSafeMerge(boolean safeMerge) |
protected void |
setShowAll(boolean showAll) |
protected void |
setTheirChunks(int theirChunks) |
protected void |
setTheirName(java.lang.String theirName) |
protected void |
setTheirTmpFile(RpcPerforceFile theirTmpFile) |
protected void |
setTheirTmpFilename(java.lang.String theirTmpFilename) |
protected void |
setTheirTmpFileStream(RpcOutputStream theirTmpFileStream) |
protected void |
setTmpDir(java.lang.String tmpDir) |
protected void |
setTwoWayMerge(boolean twoWayMerge) |
protected void |
setYourChunks(int yourChunks) |
protected void |
setYourName(java.lang.String yourName) |
protected void |
setYourTmpFile(RpcPerforceFile yourTmpFile) |
protected void |
setYourTmpFilename(java.lang.String yourTmpFilename) |
protected void |
setYourTmpFileStream(RpcOutputStream yourTmpFileStream) |
protected int |
theirYourChunks() |
protected void |
writeBaseChunk(byte[] bytes) |
protected void |
writeMarker(java.lang.String markerString) |
protected void |
writeResultChunk(byte[] bytes) |
protected void |
writeTheirChunk(byte[] bytes) |
protected void |
writeYourChunk(byte[] bytes) |
public static final java.lang.String TRACE_PREFIX
public static final java.lang.String DEFAULT_TMPFILE_PFX
public static final java.lang.String DEFAULT_TMPFILE_SFX
protected boolean twoWayMerge
protected java.lang.String baseDigest
protected ClientMergeState(java.lang.String clientPath, boolean externalStreamMerge, RpcPerforceFileType clientType, ClientLineEnding clientLineEnding, RpcPerforceFileType resultType, ClientLineEnding resultLineEnding, java.lang.String tmpDir, java.nio.charset.Charset charset)
clientPath
- clientPathexternalStreamMerge
- set true if this is a merge from an external streamclientType
- clientTypeclientLineEnding
- clientLineEndingresultType
- resultTyperesultLineEnding
- resultLineEndingtmpDir
- the name of a suitable directory for creating temporary files incharset
- charsetprotected void openMergeFiles(RpcConnection rpcConnection) throws java.io.IOException
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...
rpcConnection
- rpcConnectionjava.io.IOException
- if there's been a problem opening any of the files.protected void writeMarker(java.lang.String markerString) throws java.io.IOException, FileDecoderException, FileEncoderException
java.io.IOException
FileDecoderException
FileEncoderException
protected void writeBaseChunk(byte[] bytes) throws java.io.IOException, FileDecoderException, FileEncoderException
java.io.IOException
FileDecoderException
FileEncoderException
protected void writeTheirChunk(byte[] bytes) throws java.io.IOException, FileDecoderException, FileEncoderException
java.io.IOException
FileDecoderException
FileEncoderException
protected void writeYourChunk(byte[] bytes) throws java.io.IOException
java.io.IOException
protected void writeResultChunk(byte[] bytes) throws java.io.IOException, FileDecoderException, FileEncoderException
java.io.IOException
FileDecoderException
FileEncoderException
protected boolean finishMerge(ClientMerge.ResolveChoice choice) throws java.io.IOException
java.io.IOException
protected java.lang.String getMergeDigestString()
protected java.lang.String getTheirDigestString()
protected java.lang.String getYourDigestString()
protected int incrYourChunks()
protected int theirYourChunks()
protected int incrConflictChunks()
protected int incrTheirChunks()
protected int incrBothChunks()
protected java.lang.String getClientPath()
protected void setClientPath(java.lang.String clientPath)
protected java.lang.String getBaseName()
protected void setBaseName(java.lang.String baseName)
protected java.lang.String getTheirName()
protected void setTheirName(java.lang.String theirName)
protected java.lang.String getYourName()
protected void setYourName(java.lang.String yourName)
protected java.lang.String getBaseTmpFilename()
protected void setBaseTmpFilename(java.lang.String baseTmpFilename)
protected java.lang.String getTheirTmpFilename()
protected void setTheirTmpFilename(java.lang.String theirTmpFilename)
protected java.lang.String getYourTmpFilename()
protected void setYourTmpFilename(java.lang.String yourTmpFilename)
protected RpcPerforceFile getBaseTmpFile()
protected void setBaseTmpFile(RpcPerforceFile baseTmpFile)
protected RpcPerforceFile getTheirTmpFile()
protected void setTheirTmpFile(RpcPerforceFile theirTmpFile)
protected RpcPerforceFile getYourTmpFile()
protected void setYourTmpFile(RpcPerforceFile yourTmpFile)
protected RpcOutputStream getBaseTmpFileStream()
protected void setBaseTmpFileStream(RpcOutputStream baseTmpFileStream)
protected RpcOutputStream getYourTmpFileStream()
protected void setYourTmpFileStream(RpcOutputStream yourTmpFileStream)
protected RpcOutputStream getTheirTmpFileStream()
protected void setTheirTmpFileStream(RpcOutputStream theirTmpFileStream)
protected int getYourChunks()
protected void setYourChunks(int yourChunks)
protected int getTheirChunks()
protected void setTheirChunks(int theirChunks)
protected int getConflictChunks()
protected void setConflictChunks(int conflictChunks)
protected int getBothChunks()
protected void setBothChunks(int bothChunks)
protected int getBits()
protected void setBits(int bits)
protected int getOldBits()
protected void setOldBits(int oldBits)
protected java.lang.String getTmpDir()
protected void setTmpDir(java.lang.String tmpDir)
protected boolean isExternalStreamMerge()
protected void setExternalStreamMerge(boolean externalStreamMerge)
protected java.lang.String getExternalTmpFilename()
protected void setExternalTmpFilename(java.lang.String externalTmpFilename)
protected RpcPerforceFile getResultTmpFile()
protected void setResultTmpFile(RpcPerforceFile resultTmpFile)
protected RpcOutputStream getResultTmpFileStream()
protected void setResultTmpFileStream(RpcOutputStream resultTmpFileStream)
protected boolean isSafeMerge()
protected void setSafeMerge(boolean safeMerge)
protected boolean isAutoMerge()
protected void setAutoMerge(boolean autoMerge)
protected boolean isShowAll()
protected void setShowAll(boolean showAll)
protected boolean isTwoWayMerge()
protected void setTwoWayMerge(boolean twoWayMerge)
protected java.lang.String getBaseDigest()
protected void setBaseDigest(java.lang.String baseDigest)