public interface

CompareService

com.atlassian.stash.compare.CompareService

Class Overview

Compares two commits. Commits can be specified by ID or by branch or tag name. For SCMs which have a concept of a short name, such as Git with its shortened SHA-1s and unqualified ref names, the fully-qualified version should be used wherever possible to avoid ambiguity.

Summary

Public Methods
void streamChanges(CompareRequest request, ChangeCallback callback)
Streams changes contained on the from ref but not on the to ref.
@Deprecated void streamChangesets(CompareRequest request, ChangesetCallback callback)
This method is deprecated. in 3.7 for removal in 5.0. All things "changeset" are being renamed to "commit", the more common term for the data they represent. Due to the significant number of touchpoints, the deprecated classes and interfaces will be left in for an entire major release cycle, rather than being removed in 4.0. Callers should use streamCommits(CompareRequest, CommitCallback) instead.
void streamCommits(CompareRequest request, CommitCallback callback)
Streams commits reachable from the from ref but not reachable from the to ref.
void streamDiff(CompareDiffRequest request, DiffContentCallback callback)
Streams the diff of the changes contained on the from ref but not on the to ref.

Public Methods

public void streamChanges (CompareRequest request, ChangeCallback callback)

Streams changes contained on the from ref but not on the to ref.

Note: Change information is not paged. Instead, it is bounded by a hard cap specified by the property page.max.changes. See the documentation for Stash config properties for more information.

Parameters
request describes the refs to compare
callback a callback for receiving the changes

@Deprecated public void streamChangesets (CompareRequest request, ChangesetCallback callback)

This method is deprecated.
in 3.7 for removal in 5.0. All things "changeset" are being renamed to "commit", the more common term for the data they represent. Due to the significant number of touchpoints, the deprecated classes and interfaces will be left in for an entire major release cycle, rather than being removed in 4.0. Callers should use streamCommits(CompareRequest, CommitCallback) instead.

Streams changesets contained on the from ref but not on the to ref.

Parameters
request describes the refs to compare
callback a callback for receiving the changesets

public void streamCommits (CompareRequest request, CommitCallback callback)

Streams commits reachable from the from ref but not reachable from the to ref.

Parameters
request describes the refs to compare
callback a callback for receiving the commits

public void streamDiff (CompareDiffRequest request, DiffContentCallback callback)

Streams the diff of the changes contained on the from ref but not on the to ref.

Note: Diff output is not paged. Instead, it is bounded by hard caps specified by the following properties:

  • page.max.diff.lines, specifying the max number of diff lines to output
  • page.max.source.length, specifying the max length of each diff line
See the documentation for Stash config properties for more information.

Parameters
request describes the refs to compare
callback a callback for receiving the diff output