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