Subversion: Mask credentials in command line everywhere

Fixes: QTCREATORBUG-28413
Change-Id: I763c26944d89a8dcc7151e10b8eed5d9642fb982
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Orgad Shaneh
2023-01-17 13:10:21 +02:00
committed by Orgad Shaneh
parent edd3c16382
commit 87e5ac7438
7 changed files with 150 additions and 95 deletions

View File

@@ -390,7 +390,8 @@ void VcsBaseClient::diff(const FilePath &workingDir, const QStringList &files,
void VcsBaseClient::log(const FilePath &workingDir,
const QStringList &files,
const QStringList &extraOptions,
bool enableAnnotationContextMenu)
bool enableAnnotationContextMenu,
const std::function<void(Utils::CommandLine &)> &addAuthOptions)
{
const QString vcsCmdString = vcsCommandString(LogCommand);
const Id kind = vcsEditorKind(LogCommand);
@@ -409,19 +410,28 @@ void VcsBaseClient::log(const FilePath &workingDir,
if (paramWidget) {
paramWidget->setBaseArguments(extraOptions);
// editor has been just created, createVcsEditor() didn't set a configuration widget yet
connect(paramWidget, &VcsBaseEditorConfig::commandExecutionRequested, this,
[=] { this->log(workingDir, files, extraOptions, enableAnnotationContextMenu); });
connect(paramWidget, &VcsBaseEditorConfig::commandExecutionRequested, this, [=] {
this->log(workingDir,
files,
extraOptions,
enableAnnotationContextMenu,
addAuthOptions);
});
editor->setEditorConfig(paramWidget);
}
}
QStringList args = {vcsCmdString};
CommandLine args{vcsBinary(), {vcsCmdString}};
if (addAuthOptions)
addAuthOptions(args);
if (paramWidget)
args << paramWidget->arguments();
else
args << extraOptions;
args << files;
enqueueJob(createCommand(workingDir, editor), args);
VcsCommand *cmd = createCommand(workingDir, editor);
cmd->addJob(args, vcsTimeoutS());
cmd->start();
}
void VcsBaseClient::revertFile(const FilePath &workingDir,