VCS: Allow remote vcs operations

Both VcsBaseClient::vcsBinary() and VcsBaseClient::processEnvironment()
get an additional parameter "FilePath target" to allow selecting binaries
and environment based on where the repository is located.

This allows to select e.g. a git binary on a remote device, and the
environment of the remote device for each VCS operation.

A bunch of file path operations are either fixed or ported to actually use
FilePath correctly.

Change-Id: I6afc645772fde3dff3ec19c13efe538e5888e952
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Marcus Tillmanns
2024-02-08 17:44:24 +01:00
parent e21b8e0c1d
commit 291a893f5f
21 changed files with 141 additions and 113 deletions

View File

@@ -33,8 +33,8 @@ ChangeSelectionDialog::ChangeSelectionDialog(const FilePath &workingDirectory, I
QWidget *parent) :
QDialog(parent)
{
m_gitExecutable = gitClient().vcsBinary();
m_gitEnvironment = gitClient().processEnvironment();
m_gitExecutable = gitClient().vcsBinary(workingDirectory);
m_gitEnvironment = gitClient().processEnvironment(workingDirectory);
resize(550, 350);
setWindowTitle(Tr::tr("Select a Git Commit"));
@@ -209,8 +209,9 @@ void ChangeSelectionDialog::recalculateCompletion()
return;
Process *process = new Process(this);
process->setEnvironment(gitClient().processEnvironment());
process->setCommand({gitClient().vcsBinary(), {"for-each-ref", "--format=%(refname:short)"}});
process->setEnvironment(gitClient().processEnvironment(workingDir));
process->setCommand(
{gitClient().vcsBinary(workingDir), {"for-each-ref", "--format=%(refname:short)"}});
process->setWorkingDirectory(workingDir);
process->setUseCtrlCStub(true);
connect(process, &Process::done, this, [this, process] {