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

@@ -61,6 +61,8 @@ inline Core::IEditor* locateEditor(const Core::ICore *core, const char *property
return 0;
}
static const char nonInteractiveOptionC[] = "--noninteractive";
namespace Mercurial {
namespace Internal {
@@ -533,7 +535,8 @@ void MercurialClient::commit(const QString &repositoryRoot, const QStringList &f
// refuse to do "autoadd" on a commit with working directory only, as this will
// add all the untracked stuff.
QTC_ASSERT(!(autoAddRemove && files.isEmpty()), return)
QStringList args(QLatin1String("commit"));
QStringList args = QStringList(QLatin1String(nonInteractiveOptionC));
args.append(QLatin1String("commit"));
if (!committerInfo.isEmpty())
args << QLatin1String("-u") << committerInfo;
args << QLatin1String("-l") << commitMessageFile;