|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MergeDocument
The interface for external modules to perform a three-way merge of a
document. It will be called when a version on one branch has to be merged
with a version on another. This decision is taken based on the structure of
the version tree and on the outcome of the TestDifference
module that applies to the document format. Such modules are declared in
/configuration/maps.xml
using the merge
element as
in the following example:
<merge>
<mime-type>text/*</mime-type>
<!-- Additional mime-type elements can come here. -->
<!-- Several path elements can come here. -->
<class>
<name>be.re.repo.mod.MergeText</name>
<!-- Optional URL relative to maps.xml.
<jar>modules/my_module.jar</jar>
</class>
</merge>
TestDifference
Method Summary | |
---|---|
void |
complete(InputStream in,
OutputStream out,
String mimeType,
Context context)
This method is called to perform completion on the contents of a version when the shouldComplete method returns true . |
boolean |
merge(InputStream base,
InputStream source,
InputStream target,
OutputStream out,
String mimeType,
Context context)
This method calculates the merge and detects possible conflicts. |
boolean |
shouldComplete(String mimeType)
|
boolean |
storeWithConflicts(String mimeType)
|
Method Detail |
---|
void complete(InputStream in, OutputStream out, String mimeType, Context context) throws IOException
shouldComplete
method returns true
. The
method can take into account the conflict resolution actions the user may
have done on the version.
in
- the inputstream of the version.out
- the outputstream into which the completed version should be
written.mimeType
- the MIME type of the document.context
- the repository context.
IOException
boolean merge(InputStream base, InputStream source, InputStream target, OutputStream out, String mimeType, Context context) throws IOException
base
- the inputstream of the version that is a common ancestor of
source
and target
in the version tree.source
- the inputstream of the version on the branch that is to be
merged into the other branch.target
- the inputstream of the version on the branch into which the
merge is being done.out
- the outputstream into which the merged result should be
written.mimeType
- the MIME type of the document.context
- the repository context.
true
if the merge is automatic, false
if
there are conflicts.
IOException
boolean shouldComplete(String mimeType)
mimeType
- the MIME type of the document.
true
if the contents of the version should be
subjected to a completion process. This normally involves a user who
interactively resolves conflicts.boolean storeWithConflicts(String mimeType)
mimeType
- the MIME type of the document.
true
if it is OK to store the result despite the
presence of conflicts, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |