Package sonia.scm.repository.api
Class DiffCommandBuilder
java.lang.Object
sonia.scm.repository.api.DiffCommandBuilder
Shows differences between revisions for a specified file or
the entire revision.
Note: One of the parameter path or revision have to be set.
Sample:
Print the differences from revision 33b93c443867:
Note: One of the parameter path or revision have to be set.
Sample:
Print the differences from revision 33b93c443867:
DiffCommandBuilder diff = repositoryService.getDiffCommand();
String content = diff.setRevision("33b93c443867").getContent();
System.out.println(content);
- Since:
- 1.17
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturns the content of the difference as string.Passes the difference of the given parameter to the outputstream.setAncestorChangeset
(String revision) Compute the incoming changes of the branch set withsetRevision(String)
in respect to the changeset given here.setFormat
(DiffFormat format) Sets the diff format which should be used for the output.setIgnoreWhitespace
(IgnoreWhitespaceLevel ignoreWhitespace) Show the difference only for the given path.setRevision
(String revision) Show the difference only for the given revision or (usingsetAncestorChangeset(String)
) between this and another revision.
-
Method Details
-
retrieveContent
Passes the difference of the given parameter to the outputstream.- Returns:
- A consumer that expects the output stream for the difference
- Throws:
IOException
-
getContent
Returns the content of the difference as string.- Returns:
- content of the difference
- Throws:
IOException
-
setFormat
Sets the diff format which should be used for the output. Note: If the repository provider does not support the diff format, it will fall back to its default format.- Parameters:
format
- format of the diff output- Returns:
this
- Since:
- 1.34
-
setAncestorChangeset
Compute the incoming changes of the branch set withsetRevision(String)
in respect to the changeset given here. In other words: What changes would be new to the ancestor changeset given here when the branch would be merged into it. Requires featureFeature.INCOMING_REVISION
!- Returns:
this
-
setPath
Show the difference only for the given path.- Parameters:
path
- path for difference- Returns:
this
-
setRevision
Show the difference only for the given revision or (usingsetAncestorChangeset(String)
) between this and another revision.- Parameters:
revision
- revision for difference- Returns:
this
-
setIgnoreWhitespace
-