forked from qt-creator/qt-creator
Perforce: Get rid of the message field from PerforceResponse struct
It's not used anymore. Change-Id: Icfdefd38942fba1a64052339aa373c0a9254f826 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -128,7 +128,6 @@ struct PerforceResponse
|
|||||||
int exitCode = -1;
|
int exitCode = -1;
|
||||||
QString stdOut;
|
QString stdOut;
|
||||||
QString stdErr;
|
QString stdErr;
|
||||||
QString message;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const VcsBaseSubmitEditorParameters submitEditorParameters {
|
const VcsBaseSubmitEditorParameters submitEditorParameters {
|
||||||
@@ -1219,7 +1218,6 @@ PerforceResponse PerforcePluginPrivate::synchronousProcess(const FilePath &worki
|
|||||||
response.exitCode = process.exitCode();
|
response.exitCode = process.exitCode();
|
||||||
response.stdErr = process.cleanedStdErr();
|
response.stdErr = process.cleanedStdErr();
|
||||||
response.stdOut = process.cleanedStdOut();
|
response.stdOut = process.cleanedStdOut();
|
||||||
response.message = process.exitMessage();
|
|
||||||
|
|
||||||
if (response.error && (flags & ErrorToWindow))
|
if (response.error && (flags & ErrorToWindow))
|
||||||
VcsOutputWindow::appendError(process.exitMessage());
|
VcsOutputWindow::appendError(process.exitMessage());
|
||||||
@@ -1234,23 +1232,17 @@ PerforceResponse PerforcePluginPrivate::runP4Cmd(const FilePath &workingDir,
|
|||||||
QTextCodec *outputCodec) const
|
QTextCodec *outputCodec) const
|
||||||
{
|
{
|
||||||
if (!settings().isValid()) {
|
if (!settings().isValid()) {
|
||||||
PerforceResponse invalidConfigResponse;
|
VcsOutputWindow::appendError(Tr::tr("Perforce is not correctly configured."));
|
||||||
invalidConfigResponse.error = true;
|
return {};
|
||||||
invalidConfigResponse.message = Tr::tr("Perforce is not correctly configured.");
|
|
||||||
VcsOutputWindow::appendError(invalidConfigResponse.message);
|
|
||||||
return invalidConfigResponse;
|
|
||||||
}
|
}
|
||||||
QStringList actualArgs = settings().commonP4Arguments(workingDir.toString());
|
QStringList actualArgs = settings().commonP4Arguments(workingDir.toString());
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
QSharedPointer<TempFileSaver> tempFile = createTemporaryArgumentFile(extraArgs, &errorMessage);
|
QSharedPointer<TempFileSaver> tempFile = createTemporaryArgumentFile(extraArgs, &errorMessage);
|
||||||
if (!tempFile.isNull()) {
|
if (!tempFile.isNull())
|
||||||
actualArgs << QLatin1String("-x") << tempFile->filePath().toString();
|
actualArgs << QLatin1String("-x") << tempFile->filePath().toString();
|
||||||
} else if (!errorMessage.isEmpty()) {
|
else if (!errorMessage.isEmpty())
|
||||||
PerforceResponse tempFailResponse;
|
return {};
|
||||||
tempFailResponse.error = true;
|
|
||||||
tempFailResponse.message = errorMessage;
|
|
||||||
return tempFailResponse;
|
|
||||||
}
|
|
||||||
actualArgs.append(args);
|
actualArgs.append(args);
|
||||||
|
|
||||||
if (flags & CommandToWindow)
|
if (flags & CommandToWindow)
|
||||||
@@ -1456,10 +1448,9 @@ bool PerforcePluginPrivate::activateCommit()
|
|||||||
const PerforceResponse submitResponse = runP4Cmd(settings().topLevelSymLinkTarget(), submitArgs,
|
const PerforceResponse submitResponse = runP4Cmd(settings().topLevelSymLinkTarget(), submitArgs,
|
||||||
LongTimeOut|RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow|ShowBusyCursor,
|
LongTimeOut|RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow|ShowBusyCursor,
|
||||||
{}, reader.data());
|
{}, reader.data());
|
||||||
if (submitResponse.error) {
|
if (submitResponse.error)
|
||||||
VcsOutputWindow::appendError(Tr::tr("p4 submit failed: %1").arg(submitResponse.message));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
VcsOutputWindow::append(submitResponse.stdOut);
|
VcsOutputWindow::append(submitResponse.stdOut);
|
||||||
if (submitResponse.stdOut.contains(QLatin1String("Out of date files must be resolved or reverted)")))
|
if (submitResponse.stdOut.contains(QLatin1String("Out of date files must be resolved or reverted)")))
|
||||||
QMessageBox::warning(perforceEditor->widget(), Tr::tr("Pending change"), Tr::tr("Could not submit the change, because your workspace was out of date. Created a pending submit instead."));
|
QMessageBox::warning(perforceEditor->widget(), Tr::tr("Pending change"), Tr::tr("Could not submit the change, because your workspace was out of date. Created a pending submit instead."));
|
||||||
|
Reference in New Issue
Block a user