forked from qt-creator/qt-creator
Mercurial: Fixed committing untracked files.
by passing -A (plus security check).
This commit is contained in:
@@ -515,12 +515,19 @@ void MercurialClient::update(const QString &repositoryRoot, const QString &revis
|
||||
}
|
||||
|
||||
void MercurialClient::commit(const QString &repositoryRoot, const QStringList &files,
|
||||
const QString &committerInfo, const QString &commitMessageFile)
|
||||
const QString &committerInfo, const QString &commitMessageFile,
|
||||
bool autoAddRemove)
|
||||
{
|
||||
// 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"));
|
||||
if (!committerInfo.isEmpty())
|
||||
args << QLatin1String("-u") << committerInfo;
|
||||
args << QLatin1String("-l") << commitMessageFile << files;
|
||||
args << QLatin1String("-l") << commitMessageFile;
|
||||
if (autoAddRemove)
|
||||
args << QLatin1String("-A");
|
||||
args << files;
|
||||
QSharedPointer<HgTask> job(new HgTask(repositoryRoot, args, false));
|
||||
enqueueJob(job);
|
||||
}
|
||||
|
@@ -89,8 +89,11 @@ public:
|
||||
void revertFile(const QString &workingDir, const QString &file, const QString &revision = QString());
|
||||
void revertRepository(const QString &workingDir, const QString &revision = QString());
|
||||
void update(const QString &repositoryRoot, const QString &revision = QString());
|
||||
void commit(const QString &repositoryRoot, const QStringList &files,
|
||||
const QString &commiterInfo, const QString &commitMessageFile);
|
||||
void commit(const QString &repositoryRoot,
|
||||
const QStringList &files,
|
||||
const QString &commiterInfo,
|
||||
const QString &commitMessageFile,
|
||||
bool autoAddRemove = false);
|
||||
|
||||
static QString findTopLevelForFile(const QFileInfo &file);
|
||||
|
||||
|
@@ -634,7 +634,7 @@ bool MercurialPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *sub
|
||||
core->fileManager()->unblockFileChange(editorFile);
|
||||
|
||||
m_client->commit(commitEditor->repoRoot(), files, commitEditor->committerInfo(),
|
||||
editorFile->fileName());
|
||||
editorFile->fileName(), true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user