forked from qt-creator/qt-creator
abort commit if commit message cannot be saved
This commit is contained in:
@@ -630,7 +630,8 @@ bool BazaarPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submit
|
||||
QStringList files = commitEditor->checkedFiles();
|
||||
if (!files.empty()) {
|
||||
//save the commit message
|
||||
m_core->fileManager()->saveFile(editorFile);
|
||||
if (!m_core->fileManager()->saveFile(editorFile))
|
||||
return false;
|
||||
|
||||
//rewrite entries of the form 'file => newfile' to 'newfile' because
|
||||
//this would mess the commit command
|
||||
|
||||
@@ -501,8 +501,9 @@ bool CVSPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEdi
|
||||
bool closeEditor = true;
|
||||
if (!fileList.empty()) {
|
||||
// get message & commit
|
||||
Core::ICore::instance()->fileManager()->saveFile(fileIFace);
|
||||
closeEditor= commit(m_commitMessageFileName, fileList);
|
||||
closeEditor = Core::ICore::instance()->fileManager()->saveFile(fileIFace);
|
||||
if (closeEditor)
|
||||
closeEditor = commit(m_commitMessageFileName, fileList);
|
||||
}
|
||||
if (closeEditor)
|
||||
cleanCommitMessageFile();
|
||||
|
||||
@@ -781,7 +781,8 @@ bool GitPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEdi
|
||||
bool closeEditor = true;
|
||||
if (!fileList.empty() || !m_commitAmendSHA1.isEmpty()) {
|
||||
// get message & commit
|
||||
m_core->fileManager()->saveFile(fileIFace);
|
||||
if (!m_core->fileManager()->saveFile(fileIFace))
|
||||
return false;
|
||||
|
||||
closeEditor = m_gitClient->addAndCommit(m_submitRepository,
|
||||
editor->panelData(),
|
||||
|
||||
@@ -664,7 +664,8 @@ bool MercurialPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *sub
|
||||
const QStringList files = commitEditor->checkedFiles();
|
||||
if (!files.empty()) {
|
||||
//save the commit message
|
||||
core->fileManager()->saveFile(editorFile);
|
||||
if (!core->fileManager()->saveFile(editorFile))
|
||||
return false;
|
||||
|
||||
QHash<int, QVariant> extraOptions;
|
||||
extraOptions[MercurialClient::AuthorCommitOptionId] = commitEditor->committerInfo();
|
||||
|
||||
@@ -1365,7 +1365,8 @@ bool PerforcePlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *subm
|
||||
m_settings.setPromptToSubmit(wantsPrompt);
|
||||
m_settings.toSettings(Core::ICore::instance()->settings());
|
||||
}
|
||||
Core::ICore::instance()->fileManager()->saveFile(fileIFace);
|
||||
if (!Core::ICore::instance()->fileManager()->saveFile(fileIFace))
|
||||
return false;
|
||||
if (answer == VCSBase::VCSBaseSubmitEditor::SubmitDiscarded) {
|
||||
cleanCommitMessageFile();
|
||||
return true;
|
||||
|
||||
@@ -512,8 +512,9 @@ bool SubversionPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *su
|
||||
bool closeEditor = true;
|
||||
if (!fileList.empty()) {
|
||||
// get message & commit
|
||||
Core::ICore::instance()->fileManager()->saveFile(fileIFace);
|
||||
closeEditor= commit(m_commitMessageFileName, fileList);
|
||||
closeEditor = Core::ICore::instance()->fileManager()->saveFile(fileIFace);
|
||||
if (closeEditor)
|
||||
closeEditor = commit(m_commitMessageFileName, fileList);
|
||||
}
|
||||
if (closeEditor)
|
||||
cleanCommitMessageFile();
|
||||
|
||||
Reference in New Issue
Block a user