Top Description Constructors Methods
org.eclipse.jgit.merge

public Class MergeFormatter

extends Object
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.nio.charset.Charset, java.util.ArrayList, .List, org.eclipse.jgit.diff.RawText

A class to convert merge results into a Git conformant textual presentation

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
formatMerge(OutputStream
the output stream where to write the textual presentation
out
,
MergeResult<RawText>
the merge result which should be presented
res
,
List<String>
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 list
seqName
,
Charset
the character set used when writing conflict metadata
charset
)

Formats the results of a merge of org.eclipse.jgit.diff.RawText objects in a Git conformant way.

public void
formatMerge(OutputStream
the java.io.OutputStream where to write the textual presentation
out
,
MergeResult<S extends Sequence>
the merge result which should be presented
res
,
String
the name ranges from the base should get
baseName
,
String
the name ranges from ours should get
oursName
,
String
the name ranges from theirs should get
theirsName
,
Charset
the character set used when writing conflict metadata
charset
)

Formats the results of a merge of exactly two org.eclipse.jgit.diff.RawText objects in a Git conformant way.

public void
formatMergeDiff3(OutputStream
the output stream where to write the textual presentation
out
,
MergeResult<RawText>
the merge result which should be presented
res
,
List<String>
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 list
seqName
,
Charset
the character set used when writing conflict metadata
charset
)

Formats the results of a merge of org.eclipse.jgit.diff.RawText objects in a Git conformant way using diff3 style.

public void
formatMergeDiff3(OutputStream
the java.io.OutputStream where to write the textual presentation
out
,
MergeResult<S extends Sequence>
the merge result which should be presented
res
,
String
the name ranges from the base should get
baseName
,
String
the name ranges from ours should get
oursName
,
String
the name ranges from theirs should get
theirsName
,
Charset
the character set used when writing conflict metadata
charset
)

Formats the results of a merge of three org.eclipse.jgit.diff.RawText objects in a Git conformant way, using diff-3 style.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MergeFormatterback to summary
public MergeFormatter()

Method Detail

formatMergeback to summary
public void formatMerge(OutputStream out, MergeResult<RawText> res, List<String> seqName, Charset charset) throws IOException

Formats the results of a merge of org.eclipse.jgit.diff.RawText objects in a Git conformant way. This method also assumes that the org.eclipse.jgit.diff.RawText objects 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:OutputStream

the output stream where to write the textual presentation

res:MergeResult<RawText>

the merge result which should be presented

seqName:List<String>

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 list

charset:Charset

the character set used when writing conflict metadata

Exceptions
IOException:
if an IO error occurred
Since
5.2
formatMergeback to summary
public void formatMerge(OutputStream out, MergeResult<S extends Sequence> res, String baseName, String oursName, String theirsName, Charset charset) throws IOException

Formats the results of a merge of exactly two org.eclipse.jgit.diff.RawText objects 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:OutputStream

the java.io.OutputStream where to write the textual presentation

res:MergeResult<S extends Sequence>

the merge result which should be presented

baseName:String

the name ranges from the base should get

oursName:String

the name ranges from ours should get

theirsName:String

the name ranges from theirs should get

charset:Charset

the character set used when writing conflict metadata

Annotations
@SuppressWarnings:unchecked
Exceptions
IOException:
if an IO error occurred
Since
5.2
formatMergeDiff3back to summary
public void formatMergeDiff3(OutputStream out, MergeResult<RawText> res, List<String> seqName, Charset charset) throws IOException

Formats the results of a merge of org.eclipse.jgit.diff.RawText objects in a Git conformant way using diff3 style. This method also assumes that the org.eclipse.jgit.diff.RawText objects 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:OutputStream

the output stream where to write the textual presentation

res:MergeResult<RawText>

the merge result which should be presented

seqName:List<String>

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 list

charset:Charset

the character set used when writing conflict metadata

Exceptions
IOException:
if an IO error occurred
Since
6.7
formatMergeDiff3back to summary
public void formatMergeDiff3(OutputStream out, MergeResult<S extends Sequence> res, String baseName, String oursName, String theirsName, Charset charset) throws IOException

Formats the results of a merge of three org.eclipse.jgit.diff.RawText objects 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:OutputStream

the java.io.OutputStream where to write the textual presentation

res:MergeResult<S extends Sequence>

the merge result which should be presented

baseName:String

the name ranges from the base should get

oursName:String

the name ranges from ours should get

theirsName:String

the name ranges from theirs should get

charset:Charset

the character set used when writing conflict metadata

Annotations
@SuppressWarnings:unchecked
Exceptions
IOException:
if an IO error occurred
Since
6.7