|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.util.diffmerge.ThreeWayMerge
public final class ThreeWayMerge
Encapsulates a three-way-merge operation, supporting internal and external merge methods.
Constructor Summary | |
---|---|
ThreeWayMerge()
Creates a ThreeWayMerge that uses default configuration. |
|
ThreeWayMerge(java.lang.String overrideMergedFileEndOfLine)
Creates a ThreeWayMerge that always uses the given end-of-line
character sequence in the output file, or the default configuration if
the parameter is null. |
Method Summary | |
---|---|
com.microsoft.tfs.util.process.ProcessRunner |
beginExternalMerge(Conflict conflict,
ExternalTool tool,
com.microsoft.tfs.util.process.ProcessFinishedHandler finishedHandler,
java.io.OutputStream capturedStandardOutput,
java.io.OutputStream capturedStandardError)
Merges the content that would resolve the given conflict via an external tool the user has configured. |
boolean |
doInternalMerge(Conflict conflict,
boolean onlyCountConflicts)
Merges the content that would resolve the given conflict. |
boolean |
endExternalMerge(com.microsoft.tfs.util.process.ProcessRunner mergeProcess)
Completes the external merge that was started by beginExternalMerge (and represented by the given mergeProcess). |
FileEncoding |
getBaseFileEncoding()
|
java.lang.String |
getBaseFileLabel()
|
java.lang.String |
getBaseFileName()
|
FileEncoding |
getIntermediateMergeEncoding()
Returns the file encoding that should be used in the intermediate merge step. |
FileEncoding |
getMergedFileEncoding()
|
java.lang.String |
getMergedFileLabel()
|
java.lang.String |
getMergedFileName()
|
FileEncoding |
getModifiedFileEncoding()
|
FileEncoding |
getOriginalFileEncoding()
|
java.lang.String |
getTheirFileLabel()
|
java.lang.String |
getTheirFileName()
|
java.lang.String |
getYourFileLabel()
|
java.lang.String |
getYourFileName()
|
void |
setBaseFileEncoding(FileEncoding encoding)
|
void |
setBaseFileLabel(java.lang.String baseFileLabel)
|
void |
setBaseFileName(java.lang.String file)
|
void |
setIntermediateMergeEncoding(FileEncoding encoding)
Sets the file encoding that will be used for the intermediate merge step. |
void |
setMergedFileEncoding(FileEncoding encoding)
|
void |
setMergedFileLabel(java.lang.String mergedFileLabel)
|
void |
setMergedFileName(java.lang.String file)
|
void |
setModifiedFileEncoding(FileEncoding encoding)
|
void |
setOriginalFileEncoding(FileEncoding encoding)
|
void |
setTheirFileLabel(java.lang.String theirFileLabel)
|
void |
setTheirFileName(java.lang.String file)
|
void |
setYourFileLabel(java.lang.String yourFileLabel)
|
void |
setYourFileName(java.lang.String file)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreeWayMerge()
ThreeWayMerge
that uses default configuration.
public ThreeWayMerge(java.lang.String overrideMergedFileEndOfLine)
ThreeWayMerge
that always uses the given end-of-line
character sequence in the output file, or the default configuration if
the parameter is null.
overrideMergedFileEndOfLine
- the end-of-line character sequence to use when writing the merged
file, or null to use the default (detected) end-of-line character
sequence.Method Detail |
---|
public void setBaseFileName(java.lang.String file)
public java.lang.String getBaseFileName()
public void setTheirFileName(java.lang.String file)
public java.lang.String getTheirFileName()
public void setYourFileName(java.lang.String file)
public java.lang.String getYourFileName()
public void setMergedFileName(java.lang.String file)
public java.lang.String getMergedFileName()
public java.lang.String getBaseFileLabel()
public java.lang.String getMergedFileLabel()
public java.lang.String getTheirFileLabel()
public java.lang.String getYourFileLabel()
public void setBaseFileLabel(java.lang.String baseFileLabel)
public void setMergedFileLabel(java.lang.String mergedFileLabel)
public void setTheirFileLabel(java.lang.String theirFileLabel)
public void setYourFileLabel(java.lang.String yourFileLabel)
public void setBaseFileEncoding(FileEncoding encoding)
public FileEncoding getBaseFileEncoding()
public void setOriginalFileEncoding(FileEncoding encoding)
public FileEncoding getOriginalFileEncoding()
public void setModifiedFileEncoding(FileEncoding encoding)
public FileEncoding getModifiedFileEncoding()
public void setMergedFileEncoding(FileEncoding encoding)
public FileEncoding getMergedFileEncoding()
public void setIntermediateMergeEncoding(FileEncoding encoding)
encoding
- public FileEncoding getIntermediateMergeEncoding()
public com.microsoft.tfs.util.process.ProcessRunner beginExternalMerge(Conflict conflict, ExternalTool tool, com.microsoft.tfs.util.process.ProcessFinishedHandler finishedHandler, java.io.OutputStream capturedStandardOutput, java.io.OutputStream capturedStandardError) throws java.io.IOException, ExternalToolException
For the state of the external merge process (whether it has completed normally, with error, still running), pass a Process
conflict
- the conflict to merge content for.tool
- the merge tool to use (must not be null
)finishedHandler
- an event handler whose methods are invoked when the process runner
reaches one of its terminal states. The caller would normally
implement the handler to call
ExternalRunner.endMerge(ProcessRunner, String)
when the
runner reaches any terminal state. May be null if no state
information is desired via the handler.capturedStandardOutput
- a stream to capture the text written by the child process to its
standard output stream. Pass null if you don't want this output.
See the warning in ProcessRunner
's Javadoc about
deadlock.
capturedStandardError
- a stream to capture the text written by the child process to its
standard error stream. Pass null if you don't want this output.
See the warning in ProcessRunner
's Javadoc about
deadlock.
java.io.IOException
- if an error occurred creating the merge output file before the
merge tool was invoked.
ExternalToolException
- if the configured merge command or arguments string caused a
problem creating the merge tool.public boolean endExternalMerge(com.microsoft.tfs.util.process.ProcessRunner mergeProcess)
mergeProcess
- the merge process to complete (if null, false is returned).
public boolean doInternalMerge(Conflict conflict, boolean onlyCountConflicts)
conflict
- the conflict to merge content for.onlyCountConflicts
- if true, no merge output will result, only conflicts are counted
(and written to the conflict parameter's MergeSummary).
CodePageMapping.UnknownCodePageException
- if one of the input code pages or the output code pages cannot be
converted to a Charset
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |