From 2fa21cbfa700766baffc5042f0d2dca1681e464e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Oct 2009 12:21:27 +0400 Subject: [PATCH] changelist conflict dialog refactored --- .../com/intellij/ui/EditorNotificationPanel.java | 5 +- .../vcs/readOnlyHandler/FileListRenderer.java | 23 +++++++ .../vcs/readOnlyHandler/ReadOnlyStatusDialog.java | 20 +----- .../ChangelistConflictAccessProvider.java | 14 +++-- .../conflicts/ChangelistConflictDialog.form | 23 ++++--- .../conflicts/ChangelistConflictDialog.java | 31 ++++++---- .../ChangelistConflictNotificationPanel.java | 72 ++++++++++++++++++++++ .../conflicts/ChangelistConflictResolution.java | 48 ++++++--------- .../conflicts/ChangelistConflictTracker.java | 43 ++++--------- .../vcs/changes/conflicts/MoveChangesDialog.java | 6 +- .../vcs/changes/ui/CommitChangeListDialog.java | 20 +++--- 11 files changed, 190 insertions(+), 115 deletions(-) create mode 100644 platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/FileListRenderer.java create mode 100644 platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictNotificationPanel.java diff --git a/platform/platform-api/src/com/intellij/ui/EditorNotificationPanel.java b/platform/platform-api/src/com/intellij/ui/EditorNotificationPanel.java index 9b69a37429..258261923f 100644 --- a/platform/platform-api/src/com/intellij/ui/EditorNotificationPanel.java +++ b/platform/platform-api/src/com/intellij/ui/EditorNotificationPanel.java @@ -18,7 +18,7 @@ import java.awt.*; public class EditorNotificationPanel extends JPanel { protected final JLabel myLabel = new JLabel(); - private final JPanel myLinksPanel; + protected final JPanel myLinksPanel; public EditorNotificationPanel() { super(new BorderLayout()); @@ -35,7 +35,7 @@ public class EditorNotificationPanel extends JPanel { myLabel.setText(text); } - public void createActionLabel(final String text, @NonNls final String actionId) { + public HyperlinkLabel createActionLabel(final String text, @NonNls final String actionId) { HyperlinkLabel label = new HyperlinkLabel(text, Color.BLUE, LightColors.YELLOW, Color.BLUE); label.addHyperlinkListener(new HyperlinkListener() { public void hyperlinkUpdate(final HyperlinkEvent e) { @@ -45,6 +45,7 @@ public class EditorNotificationPanel extends JPanel { } }); myLinksPanel.add(label); + return label; } protected void executeAction(final String actionId) { diff --git a/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/FileListRenderer.java b/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/FileListRenderer.java new file mode 100644 index 0000000000..a5c4fae9a9 --- /dev/null +++ b/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/FileListRenderer.java @@ -0,0 +1,23 @@ +package com.intellij.openapi.vcs.readOnlyHandler; + +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.ui.ColoredListCellRenderer; +import com.intellij.ui.SimpleTextAttributes; + +import javax.swing.*; + +public class FileListRenderer extends ColoredListCellRenderer { + protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) { + // paint selection only as a focus rectangle + mySelected = false; + setBackground(null); + VirtualFile vf = (VirtualFile) value; + setIcon(vf.getIcon()); + append(vf.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES); + VirtualFile parent = vf.getParent(); + if (parent != null) { + append(" (" + FileUtil.toSystemDependentName(parent.getPath()) + ")", SimpleTextAttributes.GRAY_ATTRIBUTES); + } + } +} diff --git a/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/ReadOnlyStatusDialog.java b/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/ReadOnlyStatusDialog.java index ad84533b69..4b5f5172d4 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/ReadOnlyStatusDialog.java +++ b/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/ReadOnlyStatusDialog.java @@ -6,12 +6,8 @@ package com.intellij.openapi.vcs.readOnlyHandler; import com.intellij.util.ui.OptionsDialog; import com.intellij.openapi.project.Project; -import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.vcs.VcsBundle; -import com.intellij.ui.ColoredListCellRenderer; -import com.intellij.ui.SimpleTextAttributes; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.NonNls; @@ -39,20 +35,7 @@ public class ReadOnlyStatusDialog extends OptionsDialog { else { myUsingFileSystemRadioButton.setSelected(true); } - myFileList.setCellRenderer(new ColoredListCellRenderer() { - protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) { - // paint selection only as a focus rectangle - mySelected = false; - setBackground(null); - VirtualFile vf = (VirtualFile) value; - setIcon(vf.getIcon()); - append(vf.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES); - VirtualFile parent = vf.getParent(); - if (parent != null) { - append(" (" + FileUtil.toSystemDependentName(parent.getPath()) + ")", SimpleTextAttributes.GRAY_ATTRIBUTES); - } - } - }); + myFileList.setCellRenderer(new FileListRenderer()); setTitle(VcsBundle.message("dialog.title.clear.read.only.file.status")); init(); @@ -137,4 +120,5 @@ public class ReadOnlyStatusDialog extends OptionsDialog { final JRootPane pane = getRootPane(); return pane != null ? pane.getDefaultButton() : null; } + } \ No newline at end of file diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictAccessProvider.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictAccessProvider.java index c372520128..b8fc2fcbe1 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictAccessProvider.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictAccessProvider.java @@ -46,12 +46,16 @@ public class ChangelistConflictAccessProvider implements WritingAccessProvider { changeLists.add(myManager.getChangeList(file)); changes.add(myManager.getChange(file)); } - ChangelistConflictDialog dialog = new ChangelistConflictDialog(myProject, new ArrayList(changeLists), changes); - dialog.show(); + + ChangelistConflictDialog dialog; + do { + dialog = new ChangelistConflictDialog(myProject, new ArrayList(changeLists), denied); + dialog.show(); + } while (dialog.isOK() && !dialog.getResolution().resolveConflict(myProject, changes)); + if (dialog.isOK()) { - ChangelistConflictResolution resolution = dialog.getResolution(); - options.LAST_RESOLUTION = resolution; - resolution.resolveConflict(myProject, resolution == ChangelistConflictResolution.SWITCH ? changes : dialog.getSelectedChanges()); + options.LAST_RESOLUTION = dialog.getResolution(); + return Collections.emptyList(); } } return denied; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictDialog.form b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictDialog.form index 5e91e2f20f..7627f71451 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictDialog.form +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictDialog.form @@ -8,14 +8,6 @@ - - - - - - - - @@ -64,9 +56,22 @@ - + + + + + + + + + + + + + + diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictDialog.java index 984a447d1c..1266cf0881 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictDialog.java @@ -1,45 +1,51 @@ package com.intellij.openapi.vcs.changes.conflicts; +import com.intellij.openapi.options.ShowSettingsUtil; import com.intellij.openapi.project.Project; -import com.intellij.openapi.vcs.changes.Change; +import com.intellij.openapi.ui.DialogWrapper; +import com.intellij.openapi.vcs.VcsBundle; import com.intellij.openapi.vcs.changes.ChangeList; import com.intellij.openapi.vcs.changes.ChangeListManager; import com.intellij.openapi.vcs.changes.ChangeListManagerImpl; -import com.intellij.openapi.vcs.VcsBundle; -import com.intellij.openapi.options.ShowSettingsUtil; +import com.intellij.openapi.vcs.readOnlyHandler.FileListRenderer; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.ui.CollectionListModel; import javax.swing.*; -import java.util.List; import java.awt.event.ActionEvent; +import java.util.List; /** * @author Dmitry Avdeev */ -public class ChangelistConflictDialog extends MoveChangesDialog { +public class ChangelistConflictDialog extends DialogWrapper { private JPanel myPanel; - private JPanel myTopPanel; private JRadioButton myShelveChangesRadioButton; private JRadioButton myMoveChangesToActiveRadioButton; private JRadioButton mySwitchToChangelistRadioButton; private JRadioButton myIgnoreRadioButton; + private JList myFileList; private final Project myProject; - public ChangelistConflictDialog(Project project, - List changeLists, - List conflicts) { - super(project, conflicts, changeLists, "Resolve Changelist Conflict"); + public ChangelistConflictDialog(Project project, List changeLists, List conflicts) { + super(project); myProject = project; - myTopPanel.add(super.createCenterPanel()); + + setTitle("Resolve Changelist Conflict"); + + myFileList.setCellRenderer(new FileListRenderer()); + myFileList.setModel(new CollectionListModel(conflicts)); + ChangeListManagerImpl manager = ChangeListManagerImpl.getInstanceImpl(myProject); ChangelistConflictResolution resolution = manager.getConflictTracker().getOptions().LAST_RESOLUTION; if (changeLists.size() > 1) { mySwitchToChangelistRadioButton.setEnabled(false); if (resolution == ChangelistConflictResolution.SWITCH) { - resolution = ChangelistConflictResolution.SHELVE; + resolution = ChangelistConflictResolution.IGNORE; } } mySwitchToChangelistRadioButton.setText(VcsBundle.message("switch.to.changelist", changeLists.iterator().next().getName())); @@ -63,7 +69,6 @@ public class ChangelistConflictDialog extends MoveChangesDialog { init(); } - @Override protected JComponent createCenterPanel() { return myPanel; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictNotificationPanel.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictNotificationPanel.java new file mode 100644 index 0000000000..5b85bf66f0 --- /dev/null +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictNotificationPanel.java @@ -0,0 +1,72 @@ +package com.intellij.openapi.vcs.changes.conflicts; + +import com.intellij.openapi.options.ShowSettingsUtil; +import com.intellij.openapi.util.IconLoader; +import com.intellij.openapi.vcs.changes.Change; +import com.intellij.openapi.vcs.changes.ChangeList; +import com.intellij.openapi.vcs.changes.ChangeListManager; +import com.intellij.openapi.vcs.changes.ChangeListManagerImpl; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.ui.EditorNotificationPanel; +import com.intellij.ui.InplaceButton; + +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.Collections; +import java.util.List; + +/** +* @author Dmitry Avdeev +*/ +public class ChangelistConflictNotificationPanel extends EditorNotificationPanel { + + private final ChangeList myChangeList; + private final Change myChange; + private final VirtualFile myFile; + private ChangelistConflictTracker myTracker; + + public ChangelistConflictNotificationPanel(ChangelistConflictTracker tracker, VirtualFile file) { + + myTracker = tracker; + myFile = file; + final ChangeListManager manager = tracker.getChangeListManager(); + myChange = manager.getChange(file); + myChangeList = manager.getChangeList(myChange); + assert myChangeList != null; + myLabel.setText("File from non-active changelist is modified"); + createActionLabel("Move changes", "move"). + setToolTipText("Move changes to active changelist (" + manager.getDefaultChangeList().getName() + ")"); + createActionLabel("Switch changelist", "switch"). + setToolTipText("Set active changelist to '" + myChangeList.getName() + "'"); + createActionLabel("Ignore", "ignore"). + setToolTipText("Hide this notification"); + setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); + + myLinksPanel.add(new InplaceButton("Show options dialog", IconLoader.getIcon("/general/ideOptions.png"), new ActionListener() { + public void actionPerformed(ActionEvent e) { + + ShowSettingsUtil.getInstance().editConfigurable(myTracker.getProject(), + new ChangelistConflictConfigurable((ChangeListManagerImpl)manager)); + } + })); + } + + @Override + protected void executeAction(String actionId) { + if (actionId.equals("move")) { + MoveChangesDialog dialog = + new MoveChangesDialog(myTracker.getProject(), Collections.singletonList(myChange), Collections.singleton(myChangeList), + "Move Changes to Active Changelist"); + dialog.show(); + if (dialog.isOK()) { + ChangelistConflictResolution.MOVE.resolveConflict(myTracker.getProject(), dialog.getSelectedChanges()); + } + } else if (actionId.equals("switch")) { + List changes = Collections.singletonList(myTracker.getChangeListManager().getChange(myFile)); + ChangelistConflictResolution.SWITCH.resolveConflict(myTracker.getProject(), changes); + } else if (actionId.equals("ignore")) { + myTracker.ignoreConflict(myFile, true); + } + } +} diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictResolution.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictResolution.java index 13d881fe60..db5213b957 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictResolution.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictResolution.java @@ -1,19 +1,14 @@ package com.intellij.openapi.vcs.changes.conflicts; -import com.intellij.CommonBundle; -import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.project.Project; -import com.intellij.openapi.ui.Messages; -import com.intellij.openapi.vcs.VcsBundle; -import com.intellij.openapi.vcs.changes.Change; -import com.intellij.openapi.vcs.changes.ChangeListManager; -import com.intellij.openapi.vcs.changes.ChangeListManagerImpl; -import com.intellij.openapi.vcs.changes.LocalChangeList; -import com.intellij.openapi.vcs.changes.shelf.ShelveChangesManager; +import com.intellij.openapi.vcs.changes.*; +import com.intellij.openapi.vcs.changes.shelf.ShelveChangesCommitExecutor; +import com.intellij.openapi.vcs.changes.ui.CommitChangeListDialog; import com.intellij.openapi.vfs.VirtualFile; import java.util.Collection; +import java.util.HashSet; +import java.util.Set; /** * @author Dmitry Avdeev @@ -22,32 +17,29 @@ public enum ChangelistConflictResolution { SHELVE { @Override - public boolean resolveConflict(final Project project, Collection changes) { + public boolean resolveConflict(Project project, Collection changes) { LocalChangeList changeList = getManager(project).getChangeList(changes.iterator().next()); - assert changeList != null; - try { - ShelveChangesManager.getInstance(project).shelveChanges(changes, changeList.getName()); - return true; - } - catch (final Exception ex) { - ApplicationManager.getApplication().invokeLater(new Runnable() { - public void run() { - Messages.showErrorDialog(project, VcsBundle.message("create.patch.error.title", ex.getMessage()), CommonBundle.getErrorTitle()); - } - }, ModalityState.NON_MODAL); - return false; - } + return CommitChangeListDialog.commitChanges(project, changes, changeList, new ShelveChangesCommitExecutor(project), null); }}, MOVE { @Override public boolean resolveConflict(Project project, Collection changes) { - final ChangeListManagerImpl manager = getManager(project); - manager.moveChangesTo(manager.getDefaultChangeList(), changes.toArray(new Change[changes.size()])); - return true; + ChangeListManagerImpl manager = getManager(project); + Set changeLists = new HashSet(); + for (Change change : changes) { + changeLists.add(manager.getChangeList(change)); + } + MoveChangesDialog dialog = new MoveChangesDialog(project, changes, changeLists, "Move Changes"); + dialog.show(); + if (dialog.isOK()) { + manager.moveChangesTo(manager.getDefaultChangeList(), changes.toArray(new Change[changes.size()])); + return true; + } + return false; }}, - SWITCH { + SWITCH{ @Override public boolean resolveConflict(Project project, Collection changes) { LocalChangeList changeList = getManager(project).getChangeList(changes.iterator().next()); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictTracker.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictTracker.java index 8258b37d52..00d0d1a7bb 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictTracker.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictTracker.java @@ -41,7 +41,6 @@ import org.jdom.Element; import org.jetbrains.annotations.NotNull; import java.util.Collection; -import java.util.Collections; import java.util.List; import java.util.Map; @@ -158,33 +157,8 @@ public class ChangelistConflictTracker { for (FileEditor editor : editors) { EditorNotificationPanel panel = editor.getUserData(KEY); if (add && panel == null) { - panel = new EditorNotificationPanel() { - { - myLabel.setText("File from non-active changelist is modified"); - } - @Override - protected void executeAction(String actionId) { - if (actionId.equals("move")) { - Change change = myChangeListManager.getChange(file); - ChangeList changeList = myChangeListManager.getChangeList(change); - MoveChangesDialog dialog = - new MoveChangesDialog(myProject, Collections.singletonList(change), Collections.singletonList(changeList), - "Move changes"); - dialog.show(); - if (dialog.isOK()) { - ChangelistConflictResolution.MOVE.resolveConflict(myProject, dialog.getSelectedChanges()); - } - } else if (actionId.equals("switch")) { - List changes = Collections.singletonList(myChangeListManager.getChange(file)); - ChangelistConflictResolution.SWITCH.resolveConflict(myProject, changes); - } else if (actionId.equals("ignore")) { - ignoreConflict(file, true); - } - } - }; - panel.createActionLabel("Move changes", "move"); - panel.createActionLabel("Switch changelist", "switch"); - panel.createActionLabel("Ignore", "ignore"); + panel = new ChangelistConflictNotificationPanel(ChangelistConflictTracker.this, file); + myFileEditorManager.addTopComponent(editor, panel); editor.putUserData(KEY, panel); } else if (panel != null) { @@ -315,15 +289,24 @@ public class ChangelistConflictTracker { myFileStatusManager.fileStatusChanged(file); } + public Project getProject() { + return myProject; + } + + public ChangeListManager getChangeListManager() { + return myChangeListManager; + } + public Options getOptions() { return myOptions; } public static class Options { public boolean TRACKING_ENABLED = true; - public boolean SHOW_DIALOG = true; + public boolean SHOW_DIALOG = false; public boolean HIGHLIGHT_CONFLICTS = true; public boolean HIGHLIGHT_NON_ACTIVE_CHANGELIST = false; - public ChangelistConflictResolution LAST_RESOLUTION = ChangelistConflictResolution.SHELVE; + public ChangelistConflictResolution LAST_RESOLUTION = ChangelistConflictResolution.IGNORE; } + } \ No newline at end of file diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/MoveChangesDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/MoveChangesDialog.java index f461fff5a3..b5ac368c3f 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/MoveChangesDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/MoveChangesDialog.java @@ -32,7 +32,9 @@ import javax.swing.*; import javax.swing.tree.DefaultTreeModel; import java.awt.*; import java.util.ArrayList; +import java.util.Collection; import java.util.List; +import java.util.Set; /** * @author Dmitry Avdeev @@ -40,7 +42,7 @@ import java.util.List; public class MoveChangesDialog extends DialogWrapper { private ChangesTreeList myTreeList; - public MoveChangesDialog(final Project project, List selected, final List changeLists, String title) { + public MoveChangesDialog(final Project project, Collection selected, final Set changeLists, String title) { super(project, true); setTitle(title); myTreeList = new ChangesTreeList(project, selected, true, false, null, null) { @@ -48,7 +50,7 @@ public class MoveChangesDialog extends DialogWrapper { @Override protected DefaultTreeModel buildTreeModel(List changes, ChangeNodeDecorator changeNodeDecorator) { TreeModelBuilder builder = new TreeModelBuilder(project, false); - return builder.buildModel(changeLists); + return builder.buildModel(new ArrayList(changeLists)); } @Override diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java index a75359684b..799a7c1c84 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java @@ -100,12 +100,16 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj private final MyUpdateButtonsRunnable myUpdateButtonsRunnable = new MyUpdateButtonsRunnable(this); - private static void commit(final Project project, final List changes, final LocalChangeList initialSelection, + private static boolean commit(final Project project, final List changes, final LocalChangeList initialSelection, final List executors, final boolean showVcsCommit, final String comment) { final ChangeListManager manager = ChangeListManager.getInstance(project); final LocalChangeList defaultList = manager.getDefaultChangeList(); final ArrayList changeLists = new ArrayList(manager.getChangeListsCopy()); - new CommitChangeListDialog(project, changes, initialSelection, executors, showVcsCommit, defaultList, changeLists, null, false, comment).show(); + CommitChangeListDialog dialog = + new CommitChangeListDialog(project, changes, initialSelection, executors, showVcsCommit, defaultList, changeLists, null, false, + comment); + dialog.show(); + return dialog.isOK(); } public static void commitPaths(final Project project, Collection paths, final LocalChangeList initialSelection, @@ -119,26 +123,26 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj commitChanges(project, changes, initialSelection, executor, comment); } - public static void commitChanges(final Project project, final Collection changes, final LocalChangeList initialSelection, + public static boolean commitChanges(final Project project, final Collection changes, final LocalChangeList initialSelection, final CommitExecutor executor, final String comment) { final ChangeListManager manager = ChangeListManager.getInstance(project); if (executor == null) { - commitChanges(project, changes, initialSelection, manager.getRegisteredExecutors(), true, comment); + return commitChanges(project, changes, initialSelection, manager.getRegisteredExecutors(), true, comment); } else { - commitChanges(project, changes, initialSelection, Collections.singletonList(executor), false, comment); + return commitChanges(project, changes, initialSelection, Collections.singletonList(executor), false, comment); } } - public static void commitChanges(final Project project, final Collection changes, final LocalChangeList initialSelection, + public static boolean commitChanges(final Project project, final Collection changes, final LocalChangeList initialSelection, final List executors, final boolean showVcsCommit, final String comment) { if (changes.isEmpty()) { Messages.showWarningDialog(project, VcsBundle.message("commit.dialog.no.changes.detected.text") , VcsBundle.message("commit.dialog.no.changes.detected.title")); - return; + return false; } - commit(project, new ArrayList(changes), initialSelection, executors, showVcsCommit, comment); + return commit(project, new ArrayList(changes), initialSelection, executors, showVcsCommit, comment); } public static void commitAlienChanges(final Project project, final List changes, final AbstractVcs vcs, -- 2.11.4.GIT