IVersionControl: Add method to get a ShellCommand for initial checkouts

Change-Id: Iabc056dad186d788003b221afb34303c37fef728
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tobias Hunger
2015-04-29 14:34:07 +02:00
parent f5dcc93b7e
commit 75f067550f
15 changed files with 153 additions and 5 deletions

View File

@@ -38,6 +38,7 @@ namespace Bazaar {
namespace Internal {
class BazaarSettings;
class BazaarControl;
class BazaarClient : public VcsBase::VcsBaseClient
{
@@ -70,6 +71,7 @@ protected:
private:
friend class CloneWizard;
friend class BazaarControl;
};
} // namespace Internal

View File

@@ -29,8 +29,11 @@
****************************************************************************/
#include "bazaarcontrol.h"
#include "bazaarclient.h"
#include "bazaarplugin.h"
#include <vcsbase/vcsbaseclientsettings.h>
#include <vcsbase/vcsbaseconstants.h>
#include <vcsbase/vcscommand.h>
#include <utils/fileutils.h>
@@ -88,6 +91,7 @@ bool BazaarControl::supportsOperation(Operation operation) const
case Core::IVersionControl::MoveOperation:
case Core::IVersionControl::CreateRepositoryOperation:
case Core::IVersionControl::AnnotateOperation:
case Core::IVersionControl::InitialCheckoutOperation:
break;
case Core::IVersionControl::SnapshotOperations:
supported = false;
@@ -135,6 +139,21 @@ bool BazaarControl::vcsAnnotate(const QString &file, int line)
return true;
}
Core::ShellCommand *BazaarControl::createInitialCheckoutCommand(const QString &url,
const Utils::FileName &baseDirectory,
const QString &localName,
const QStringList &extraArgs)
{
QStringList args;
args << m_bazaarClient->vcsCommandString(BazaarClient::CloneCommand)
<< extraArgs << url << localName;
auto command = new VcsBase::VcsCommand(baseDirectory.toString(),
m_bazaarClient->processEnvironment());
command->addJob(m_bazaarClient->vcsBinary(), args, -1);
return command;
}
void BazaarControl::changed(const QVariant &v)
{
switch (v.type()) {

View File

@@ -64,6 +64,11 @@ public:
bool vcsCreateRepository(const QString &directory) override;
bool vcsAnnotate(const QString &file, int line) override;
Core::ShellCommand *createInitialCheckoutCommand(const QString &url,
const Utils::FileName &baseDirectory,
const QString &localName,
const QStringList &extraArgs) override;
public slots:
// To be connected to the VCSTask's success signal to emit the repository/
// files changed signals according to the variant's type: