/*!
* Called to clone/checkout the version control system in a directory.
*/
- virtual bool vcsCheckout(const QString &directory,const QByteArray &url) = 0;
+ virtual bool vcsCheckout(const QString &directory, const QByteArray &url) = 0;
/*!
* Called to get the version control repository root.
return true;
}
-IVersionControl* VCSManager::checkout(const QString &versionControlType,
+IVersionControl *VCSManager::checkout(const QString &versionControlType,
const QString &directory,
const QByteArray &url)
{
- foreach (IVersionControl * versionControl, allVersionControls()) {
- if (versionControl->displayName() == versionControlType &&
- versionControl->supportsOperation(Core::IVersionControl::CheckoutOperation)) {
- if (versionControl->vcsCheckout(directory,url)) {
+ foreach (IVersionControl *versionControl, allVersionControls()) {
+ if (versionControl->displayName() == versionControlType
+ && versionControl->supportsOperation(Core::IVersionControl::CheckoutOperation)) {
+ if (versionControl->vcsCheckout(directory, url)) {
m_d->m_cachedMatches.insert(directory, versionControl);
return versionControl;
}
bool VCSManager::findVersionControl(const QString &versionControlType)
{
foreach (IVersionControl * versionControl, allVersionControls()) {
- if (versionControl->displayName() == versionControlType) {
+ if (versionControl->displayName() == versionControlType)
return true;
- }
}
return false;
}
return QString();
}
-bool CVSControl::vcsCheckout(const QString &/*directory*/, const QByteArray &/*url*/)
+bool CVSControl::vcsCheckout(const QString &, const QByteArray &)
{
return false;
}
bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
{
QDir workingDirectory(directory);
- const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt
- |VCSBase::VCSBasePlugin::ShowStdOutInLogWindow
- |VCSBase::VCSBasePlugin::ShowSuccessMessage;
+ const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt |
+ VCSBase::VCSBasePlugin::ShowStdOutInLogWindow|
+ VCSBase::VCSBasePlugin::ShowSuccessMessage;
if (workingDirectory.exists()) {
if (!synchronousInit(workingDirectory.path()))
QStringList arguments(QLatin1String("remote"));
arguments << QLatin1String("add") << QLatin1String("origin") << url;
- if (!fullySynchronousGit(workingDirectory.path(),arguments,0,0,true))
- return false;
+ if (!fullySynchronousGit(workingDirectory.path(), arguments, 0, 0, true))
+ return false;
arguments.clear();
arguments << QLatin1String("fetch");
- const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory.path(),arguments,flags);
+ const Utils::SynchronousProcessResponse resp =
+ synchronousGit(workingDirectory.path(), arguments, flags);
if (resp.result != Utils::SynchronousProcessResponse::Finished)
return false;
arguments.clear();
- arguments << QLatin1String("config") << QLatin1String("branch.master.remote") << QLatin1String("origin");
- if (!fullySynchronousGit(workingDirectory.path(),arguments,0,0,true))
+ arguments << QLatin1String("config")
+ << QLatin1String("branch.master.remote")
+ << QLatin1String("origin");
+ if (!fullySynchronousGit(workingDirectory.path(), arguments, 0, 0, true))
return false;
arguments.clear();
- arguments << QLatin1String("config") << QLatin1String("branch.master.merge") << QLatin1String("refs/heads/master");
- if (!fullySynchronousGit(workingDirectory.path(),arguments,0,0,true))
+ arguments << QLatin1String("config")
+ << QLatin1String("branch.master.merge")
+ << QLatin1String("refs/heads/master");
+ if (!fullySynchronousGit(workingDirectory.path(), arguments, 0, 0, true))
return false;
return true;
QStringList arguments(QLatin1String("clone"));
arguments << url << workingDirectory.dirName();
workingDirectory.cdUp();
- const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory.path(),arguments,flags);
+ const Utils::SynchronousProcessResponse resp =
+ synchronousGit(workingDirectory.path(), arguments, flags);
return resp.result == Utils::SynchronousProcessResponse::Finished;
}
}
arguments << QLatin1String("remote.origin.url");
- if (fullySynchronousGit(directory,arguments,&outputText,0,false)) {
+ if (fullySynchronousGit(directory, arguments, &outputText, 0, false)) {
return commandOutputFromLocal8Bit(outputText);
}
return QString();
unsigned gitVersion(bool silent, QString *errorMessage = 0);
QString gitVersionString(bool silent, QString *errorMessage = 0);
- bool cloneRepository(const QString &directory,const QByteArray &url);
+ bool cloneRepository(const QString &directory, const QByteArray &url);
QString vcsGetRepositoryURL(const QString &directory);
bool synchronousFetch(const QString &workingDirectory);
bool synchronousPull(const QString &workingDirectory);
return gitClient()->synchronousInit(directory);
}
-bool GitVersionControl::vcsCheckout(const QString &directory,const QByteArray &url)
-{
+bool GitVersionControl::vcsCheckout(const QString &directory, const QByteArray &url)
+{
return gitClient()->cloneRepository(directory,url);
}
QString GitVersionControl::vcsGetRepositoryURL(const QString &directory)
-{
+{
return gitClient()->vcsGetRepositoryURL(directory);
}
{
QDir workingDirectory(directory);
QByteArray output;
- const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt|VCSBase::VCSBasePlugin::ShowStdOutInLogWindow
- |VCSBase::VCSBasePlugin::ShowSuccessMessage;
+ const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt |
+ VCSBase::VCSBasePlugin::ShowStdOutInLogWindow |
+ VCSBase::VCSBasePlugin::ShowSuccessMessage;
if (workingDirectory.exists()) {
// Let's make first init
return true;
}
-bool PerforceVersionControl::vcsCheckout(const QString &/*directory*/,const QByteArray&/*url*/)
+bool PerforceVersionControl::vcsCheckout(const QString &,const QByteArray &)
{
return false;
}
-QString PerforceVersionControl::vcsGetRepositoryURL(const QString &/*directory*/)
+QString PerforceVersionControl::vcsGetRepositoryURL(const QString &)
{
return QString();
}
return m_plugin->vcsMove(fromInfo.absolutePath(), fromInfo.absoluteFilePath(), toInfo.absoluteFilePath());
}
-bool SubversionControl::vcsCheckout(const QString &directory,const QByteArray &url)
+bool SubversionControl::vcsCheckout(const QString &directory, const QByteArray &url)
{
- return m_plugin->vcsCheckout(directory,url);
+ return m_plugin->vcsCheckout(directory, url);
}
QString SubversionControl::vcsGetRepositoryURL(const QString &directory)
// be a bug in subversion, so this might get fixed in the future.
tempUrl.setUserInfo("");
args << tempUrl.toEncoded() << directory;
- const SubversionResponse response = runSvn(directory, username, password, args, m_settings.longTimeOutMS(),
- VCSBase::VCSBasePlugin::SshPasswordPrompt);
+ const SubversionResponse response = runSvn(directory, username, password, args,
+ m_settings.longTimeOutMS(),
+ VCSBase::VCSBasePlugin::SshPasswordPrompt);
return !response.error;
} else {
args << url << directory;
const SubversionResponse response = runSvn(directory, args, m_settings.longTimeOutMS(),
- VCSBase::VCSBasePlugin::SshPasswordPrompt);
+ VCSBase::VCSBasePlugin::SshPasswordPrompt);
return !response.error;
}
}