java.lang.Object
org.eclipse.jgit.merge.MergeFormatter
A class to convert merge results into a Git conformant textual presentation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidformatMerge(OutputStream out, MergeResult<RawText> res, List<String> seqName, Charset charset) Formats the results of a merge ofRawTextobjects in a Git conformant way.voidformatMerge(OutputStream out, MergeResult res, String baseName, String oursName, String theirsName, Charset charset) Formats the results of a merge of exactly twoRawTextobjects in a Git conformant way.voidformatMergeDiff3(OutputStream out, MergeResult<RawText> res, List<String> seqName, Charset charset) Formats the results of a merge ofRawTextobjects in a Git conformant way using diff3 style.voidformatMergeDiff3(OutputStream out, MergeResult res, String baseName, String oursName, String theirsName, Charset charset) Formats the results of a merge of threeRawTextobjects in a Git conformant way, using diff-3 style.
-
Constructor Details
-
MergeFormatter
public MergeFormatter()
-
-
Method Details
-
formatMerge
public void formatMerge(OutputStream out, MergeResult<RawText> res, List<String> seqName, Charset charset) throws IOException Formats the results of a merge ofRawTextobjects in a Git conformant way. This method also assumes that theRawTextobjects being merged are line oriented files which use LF as delimiter. This method will also use LF to separate chunks and conflict metadata, therefore it fits only to texts that are LF-separated lines.- Parameters:
out- the output stream where to write the textual presentationres- the merge result which should be presentedseqName- When a conflict is reported each conflicting range will get a name. This name is following the "<<<<<<< " or ">>>>>>> " conflict markers. The names for the sequences are given in this listcharset- the character set used when writing conflict metadata- Throws:
IOException- if an IO error occurred- Since:
- 5.2
-
formatMergeDiff3
public void formatMergeDiff3(OutputStream out, MergeResult<RawText> res, List<String> seqName, Charset charset) throws IOException Formats the results of a merge ofRawTextobjects in a Git conformant way using diff3 style. This method also assumes that theRawTextobjects being merged are line oriented files which use LF as delimiter. This method will also use LF to separate chunks and conflict metadata, therefore it fits only to texts that are LF-separated lines.- Parameters:
out- the output stream where to write the textual presentationres- the merge result which should be presentedseqName- When a conflict is reported each conflicting range will get a name. This name is following the "<<<<<<< ", "|||||||" or ">>>>>>> " conflict markers. The names for the sequences are given in this listcharset- the character set used when writing conflict metadata- Throws:
IOException- if an IO error occurred- Since:
- 6.7
-
formatMerge
public void formatMerge(OutputStream out, MergeResult res, String baseName, String oursName, String theirsName, Charset charset) throws IOException Formats the results of a merge of exactly twoRawTextobjects in a Git conformant way. This convenience method accepts the names for the three sequences (base and the two merged sequences) as explicit parameters and doesn't require the caller to specify a List- Parameters:
out- theOutputStreamwhere to write the textual presentationres- the merge result which should be presentedbaseName- the name ranges from the base should getoursName- the name ranges from ours should gettheirsName- the name ranges from theirs should getcharset- the character set used when writing conflict metadata- Throws:
IOException- if an IO error occurred- Since:
- 5.2
-
formatMergeDiff3
public void formatMergeDiff3(OutputStream out, MergeResult res, String baseName, String oursName, String theirsName, Charset charset) throws IOException Formats the results of a merge of threeRawTextobjects in a Git conformant way, using diff-3 style. This convenience method accepts the names for the three sequences (base and the two merged sequences) as explicit parameters and doesn't require the caller to specify a List- Parameters:
out- theOutputStreamwhere to write the textual presentationres- the merge result which should be presentedbaseName- the name ranges from the base should getoursName- the name ranges from ours should gettheirsName- the name ranges from theirs should getcharset- the character set used when writing conflict metadata- Throws:
IOException- if an IO error occurred- Since:
- 6.7
-