public final enum

ConflictMarker

extends Enum<E extends Enum<E>>
java.lang.Object
   ↳ java.lang.Enum<E extends java.lang.Enum<E>>
     ↳ com.atlassian.stash.content.ConflictMarker

Class Overview

Used to mark diff lines which represent a merge conflict. Lines which are streamed via a callback will be similarly marked.

Conflicts are a natural possibility when merging pull requests. They are not expected to appear in normal changeset diffs, as it is assumed conflicts will have been resolved before the changeset is committed to the repository. The system will never introduce merge commits which include conflicts into a repository when merging a pull request; the merge attempt will throw an exception instead. Such conflicts will only be shown when streaming the diff for a pull request.

Summary

Enum Values
ConflictMarker  MARKER  Indicates the line is a conflict marker. 
ConflictMarker  OURS  Indicates the line comes from our version of the file. 
ConflictMarker  THEIRS  Indicates the line comes from their version of the file. 
Public Methods
static ConflictMarker valueOf(String name)
final static ConflictMarker[] values()
[Expand]
Inherited Methods
From class java.lang.Enum
From class java.lang.Object
From interface java.lang.Comparable

Enum Values

public static final ConflictMarker MARKER

Indicates the line is a conflict marker.

Conflict markers come in three types:

  • <<<<<<<: Signals the beginning of our lines
  • =======: Signals the end of our lines and the beginning of theirs
  • >>>>>>>: Signals the end of their lines
The markers will always appear in the diff in the above order, and if any marker is seen all three will always be seen (unless the segment is truncated).

public static final ConflictMarker OURS

Indicates the line comes from our version of the file. This is the version that is already on the branch to which the changes are being merged.

Note: Our lines always appear as context lines, because they are in the file already. As they are context, how many appear in the diff is dependent on the amount of context being shown. That means it is possible that some number of our lines will be omitted, if the markers bound a set of lines greater than the amount of context being shown. If any lines are omitted, it will cause our lines to be split into two separate hunks (and, implicitly, into two segments as well).

public static final ConflictMarker THEIRS

Indicates the line comes from their version of the file. This is the version that is being merged into the branch.

Note: Their lines always appear as added lines. Because they will never be context lines, they will all always appear in the diff, in a single segment (unless the segment is truncated).

Public Methods

public static ConflictMarker valueOf (String name)

public static final ConflictMarker[] values ()