VCS[hg]: Mercurial forgets working directory from commit #2 on.

Do not clear variable containing submit repository. Fix potential
crash (closing diff editor before command termination),
use proper temp file name. Pass --non-interactive to "commit"
to suppress editors being launched (despite -l).

Reviewed-by: Marco Bubke <marco.bubke@nokia.com>
Task-number: QTCREATORBUG-1503
This commit is contained in:
Friedemann Kleint
2010-08-19 16:26:47 +02:00
parent 5b72808192
commit abaf2e9f21
4 changed files with 22 additions and 9 deletions

View File

@@ -581,7 +581,12 @@ void MercurialPlugin::showCommitWidget(const QList<QPair<QString, QString> > &st
deleteCommitLog();
changeLog = new QTemporaryFile(this);
// Open commit log
QString changeLogPattern = QDir::tempPath();
if (!changeLogPattern.endsWith(QLatin1Char('/')))
changeLogPattern += QLatin1Char('/');
changeLogPattern += QLatin1String("qtcreator-hg-XXXXXX.msg");
changeLog = new QTemporaryFile(changeLogPattern, this);
if (!changeLog->open()) {
outputWindow->appendError(tr("Unable to generate a temporary file for the commit editor."));
return;
@@ -673,7 +678,6 @@ void MercurialPlugin::deleteCommitLog()
if (changeLog) {
delete changeLog;
changeLog = 0;
m_submitRepository.clear();
}
}