Bazaar: fix commit error for 'rename' changes

Merge-request: 276
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
cerf
2011-03-18 09:55:36 +01:00
committed by Tobias Hunger
parent 750248f3e8
commit d87f03825d

View File

@@ -627,13 +627,21 @@ bool BazaarPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submit
break;
}
const QStringList files = commitEditor->checkedFiles();
QStringList files = commitEditor->checkedFiles();
if (!files.empty()) {
//save the commit message
m_core->fileManager()->blockFileChange(editorFile);
editorFile->save();
m_core->fileManager()->unblockFileChange(editorFile);
//rewrite entries of the form 'file => newfile' to 'newfile' because
//this would mess the commit command
for (QStringList::iterator iFile = files.begin(); iFile != files.end(); ++iFile) {
const QStringList parts = iFile->split(" => ", QString::SkipEmptyParts);
if (!parts.isEmpty())
*iFile = parts.last();
}
const BazaarCommitWidget* commitWidget = commitEditor->commitWidget();
BazaarClient::ExtraCommandOptions extraOptions;
extraOptions[BazaarClient::AuthorCommitOptionId] = commitWidget->committer();