Commit 469199e7 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

abort commit if commit message cannot be saved

parent 096a7aa7
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment