Class MergeSession
java.lang.Object
io.github.jbastgen.stemma.app.git.MergeSession
The state of resolving one conflicting file: the merged chunks and what the user chose for each conflict. Pure
logic; the merge tool's window only displays it.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat the user chose for one conflict. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionai(int conflictIndex) The proposal of the AI for a conflict.intaiCount()How many conflicts are to be taken from the AI proposal.choice(int conflictIndex) The choice for a conflict;conflictIndexcounts the conflicts only, from 0.voidchoose(int conflictIndex, MergeSession.Choice choice) Decides one conflict.voidchooseAll(MergeSession.Choice choice) Decides all conflicts the same way.chunks()The merged file in pieces: stable runs, merged changes and conflicts.voidclearAi()Takes back every proposal of the AI: those conflicts are open again.intHow many conflicts there are.static booleanhasMarkers(String text) Whether text still contains conflict markers at the start of a line.result()The merged text; conflicts that are not resolved yet appear with conflict markers.voidsetAi(int conflictIndex, AiMerge.Proposal proposal) Takes a proposal of the AI for a conflict; the sides stay one click away (any other choice replaces it).intHow many conflicts have no choice yet.
-
Constructor Details
-
MergeSession
public MergeSession(String base, String ours, String theirs, String oursLabel, String theirsLabel, Charset charset) - Parameters:
base- the common ancestorours- the branch that is checked outtheirs- the branch that is mergedoursLabel- the name of "ours" in the conflict markerstheirsLabel- the name of "theirs" in the conflict markerscharset- how the bytes of the file are read and written again
-
-
Method Details
-
chunks
The merged file in pieces: stable runs, merged changes and conflicts. -
conflicts
public int conflicts()How many conflicts there are. -
unresolved
public int unresolved()How many conflicts have no choice yet. -
choice
The choice for a conflict;conflictIndexcounts the conflicts only, from 0. -
choose
Decides one conflict. -
chooseAll
Decides all conflicts the same way. -
setAi
Takes a proposal of the AI for a conflict; the sides stay one click away (any other choice replaces it). -
ai
The proposal of the AI for a conflict. -
clearAi
public void clearAi()Takes back every proposal of the AI: those conflicts are open again. -
aiCount
public int aiCount()How many conflicts are to be taken from the AI proposal. -
result
The merged text; conflicts that are not resolved yet appear with conflict markers. -
hasMarkers
Whether text still contains conflict markers at the start of a line.
-