mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-152400 vcs: save previous commit message in history before overriding it on Amend
otherwise, the previous value would be lost if dialog is canceled
This commit is contained in:
@@ -25,6 +25,7 @@ import com.intellij.openapi.util.ThrowableComputable;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.CheckinProjectPanel;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.VcsConfiguration;
|
||||
import com.intellij.openapi.vcs.VcsException;
|
||||
import com.intellij.openapi.vcs.ui.RefreshableOnComponent;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -49,7 +50,7 @@ public abstract class DvcsCommitAdditionalComponent implements RefreshableOnComp
|
||||
|
||||
protected final JPanel myPanel;
|
||||
protected final JCheckBox myAmend;
|
||||
@Nullable private String myPreviousMessage;
|
||||
@Nullable private final String myPreviousMessage;
|
||||
@Nullable private String myAmendedMessage;
|
||||
@NotNull protected final CheckinProjectPanel myCheckinPanel;
|
||||
@Nullable private Map<VirtualFile, String> myMessagesForRoots;
|
||||
@@ -140,8 +141,8 @@ public abstract class DvcsCommitAdditionalComponent implements RefreshableOnComp
|
||||
}
|
||||
|
||||
private void substituteCommitMessage(@NotNull String newMessage) {
|
||||
myPreviousMessage = myCheckinPanel.getCommitMessage();
|
||||
if (!myPreviousMessage.trim().equals(newMessage.trim())) {
|
||||
VcsConfiguration.getInstance(myCheckinPanel.getProject()).saveCommitMessage(myPreviousMessage);
|
||||
myCheckinPanel.setCommitMessage(newMessage);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user