Class LabelService
java.lang.Object
io.github.jbastgen.stemma.app.label.LabelService
The commit labels for the views: knows whether the feature is on, where the index file is (it follows the
settings), and gives the labels of commits. Failures to read or write the shared file never reach the views as
exceptions: they are logged and reported to the user once per operation by the caller.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncommitsWithLabel(String repoKey, String text) Commits of a repository that have a label whose id or name matchestext(case-insensitive).int[]compact()Rewrites the file without the events that no longer matter; returns the numbers before and after.static Pathlabels.tsvin the configuration folder.voidDefines a label or changes its name or colour.voidDeletes a label for everyone.booleanenabled()Whether commit labels are switched on.file()The index file in use.intimportFrom(Path other) Takes the labels of another file over; returns how many events were new.The label with this id.labels()The labels that exist, in order.The labels of a commit, in the order of the definitions.voidMakes the labels of a commit exactlywanted(label ids).
-
Constructor Details
-
LabelService
- Parameters:
settings- the current settings, asked for every operationdefaultFile- the index file when the settings name noneclock- the time of an event
-
-
Method Details
-
defaultFile
labels.tsvin the configuration folder. -
enabled
public boolean enabled()Whether commit labels are switched on. -
file
The index file in use. -
labels
The labels that exist, in order. The default ones are written to a new index first. -
label
The label with this id. -
labelsOf
The labels of a commit, in the order of the definitions. -
commitsWithLabel
Commits of a repository that have a label whose id or name matchestext(case-insensitive). -
setLabels
Makes the labels of a commit exactlywanted(label ids).- Throws:
IOException
-
define
Defines a label or changes its name or colour.- Throws:
IOException
-
delete
Deletes a label for everyone.- Throws:
IOException
-
compact
Rewrites the file without the events that no longer matter; returns the numbers before and after.- Throws:
IOException
-
importFrom
Takes the labels of another file over; returns how many events were new.- Throws:
IOException
-