use of git4idea.rebase.GitRebaseDialog in project intellij-community by JetBrains.
the class GitRebase method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
final Project project = e.getRequiredData(CommonDataKeys.PROJECT);
ArrayList<GitRepository> repositories = ContainerUtil.newArrayList(getRepositories(project));
repositories.removeAll(getRebasingRepositories(project));
List<VirtualFile> roots = ContainerUtil.newArrayList(getRootsFromRepositories(sortRepositories(repositories)));
VirtualFile defaultRoot = DvcsUtil.guessVcsRoot(project, e.getData(CommonDataKeys.VIRTUAL_FILE));
final GitRebaseDialog dialog = new GitRebaseDialog(project, roots, defaultRoot);
if (dialog.showAndGet()) {
ProgressManager.getInstance().run(new Task.Backgroundable(project, "Rebasing...") {
public void run(@NotNull ProgressIndicator indicator) {
GitRebaseUtils.rebase(project, singletonList(dialog.getSelectedRepository()), dialog.getSelectedParams(), indicator);
}
});
}
}
Aggregations