mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: cleanup - simplify
This commit is contained in:
@@ -295,11 +295,10 @@ public class CommitHelper {
|
||||
|
||||
@Override
|
||||
public void callSelf() {
|
||||
ChangesUtil.processItemsByVcs(myIncludedChanges, change -> myVcs, this);
|
||||
ChangesUtil.processItemsByVcs(myIncludedChanges, change -> myVcs, this::process);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(@NotNull AbstractVcs vcs, @NotNull List<Change> items) {
|
||||
private void process(@NotNull AbstractVcs vcs, @NotNull List<Change> items) {
|
||||
if (myVcs.getName().equals(vcs.getName())) {
|
||||
final CheckinEnvironment environment = vcs.getCheckinEnvironment();
|
||||
if (environment != null) {
|
||||
@@ -336,7 +335,7 @@ public class CommitHelper {
|
||||
}
|
||||
}
|
||||
|
||||
private abstract static class GeneralCommitProcessor implements ChangesUtil.PerVcsProcessor<Change>, ActionsAroundRefresh {
|
||||
private abstract static class GeneralCommitProcessor {
|
||||
protected final List<FilePath> myPathsToRefresh = new ArrayList<>();
|
||||
protected final List<VcsException> myVcsExceptions = new ArrayList<>();
|
||||
protected final List<Change> myChangesFailedToCommit = new ArrayList<>();
|
||||
@@ -345,6 +344,10 @@ public class CommitHelper {
|
||||
public abstract void afterSuccessfulCheckIn();
|
||||
public abstract void afterFailedCheckIn();
|
||||
|
||||
public abstract void doBeforeRefresh();
|
||||
public abstract void customRefresh();
|
||||
public abstract void doPostRefresh();
|
||||
|
||||
public List<FilePath> getPathsToRefresh() {
|
||||
return myPathsToRefresh;
|
||||
}
|
||||
@@ -358,12 +361,6 @@ public class CommitHelper {
|
||||
}
|
||||
}
|
||||
|
||||
private interface ActionsAroundRefresh {
|
||||
void doBeforeRefresh();
|
||||
void customRefresh();
|
||||
void doPostRefresh();
|
||||
}
|
||||
|
||||
private enum ChangeListsModificationAfterCommit {
|
||||
DELETE_LIST,
|
||||
MOVE_OTHERS,
|
||||
@@ -398,11 +395,10 @@ public class CommitHelper {
|
||||
if (myVcs != null && myIncludedChanges.isEmpty()) {
|
||||
process(myVcs, myIncludedChanges);
|
||||
}
|
||||
ChangesUtil.processChangesByVcs(myProject, myIncludedChanges, this);
|
||||
ChangesUtil.processChangesByVcs(myProject, myIncludedChanges, this::process);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(@NotNull AbstractVcs vcs, @NotNull List<Change> items) {
|
||||
private void process(@NotNull AbstractVcs vcs, @NotNull List<Change> items) {
|
||||
final CheckinEnvironment environment = vcs.getCheckinEnvironment();
|
||||
if (environment != null) {
|
||||
Collection<FilePath> paths = ChangesUtil.getPaths(items);
|
||||
|
||||
Reference in New Issue
Block a user