CheckoutWizards: Use IVersionControl::createInitialCheckoutCommand

Change-Id: I09dd38f66b9cad46d561493c2e27a833595d8728
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tobias Hunger
2015-04-29 16:46:45 +02:00
parent f21d2023e8
commit 94dc35694a
9 changed files with 81 additions and 105 deletions

View File

@@ -49,14 +49,8 @@ namespace Internal {
// --------------------------------------------------------------------
CheckoutWizard::CheckoutWizard(const Utils::FileName &path, QWidget *parent) :
BaseCheckoutWizard(path, parent)
BaseCheckoutWizard(Constants::VCS_ID_CVS, parent)
{
const Core::IVersionControl *vc = CvsPlugin::instance()->versionControl();
if (!vc->isConfigured()) {
auto configPage = new VcsConfigurationPage;
configPage->setVersionControl(vc);
addPage(configPage);
}
auto cwp = new CheckoutWizardPage;
cwp->setPath(path.toString());
addPage(cwp);
@@ -69,22 +63,14 @@ VcsCommand *CheckoutWizard::createCommand(Utils::FileName *checkoutDir)
const CheckoutWizardPage *cwp = find<CheckoutWizardPage>();
QTC_ASSERT(cwp, return 0);
const CvsSettings settings = CvsPlugin::instance()->client()->settings();
const Utils::FileName binary = settings.binaryPath();
QStringList args;
*checkoutDir = Utils::FileName::fromString(cwp->path() + QLatin1Char('/') + cwp->repository());
// cwp->repository() contains the CVS module to check out only.
// The CVSROOT (== actual repository) for that module is part of the CVS settings.
// The checkout will always go into a new subfolder named after the CVS module.
const QString repository = cwp->repository();
args << QLatin1String("checkout") << repository;
const QString workingDirectory = cwp->path();
*checkoutDir = Utils::FileName::fromString(workingDirectory + QLatin1Char('/') + repository);
auto command = new VcsCommand(workingDirectory, QProcessEnvironment::systemEnvironment());
command->addJob(binary, settings.addOptions(args), -1);
return command;
return createCommandImpl(cwp->repository(), Utils::FileName::fromString(cwp->path()),
cwp->repository(), QStringList());
}
} // namespace Internal