int (@NotNull HistoryDialogModel dirHistoryModel, @NotNull LabelImpl label) { List<RevisionItem> revs = dirHistoryModel.getRevisions(); for (int i = 0; i < revs.size(); i++) { final RevisionItem rev = revs.get(i); if (isLabelRevision(rev, label)) return i; //when lvcs model is not constructed yet or is empty then PutLabelChange is created but without label, so we need to scan revisions themselves if (isChangeWithId(rev.revision, label.getLabelChangeId())) return i; } return -1; }