Commit 2cf99100 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Fixup formating of mr2178



Merge-request: 2178
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 65e95c3a
......@@ -121,7 +121,7 @@ public:
/*!
* 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.
......
......@@ -167,14 +167,14 @@ bool VCSManager::promptToDelete(const QString &fileName)
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;
}
......@@ -187,9 +187,8 @@ IVersionControl* VCSManager::checkout(const QString &versionControlType,
bool VCSManager::findVersionControl(const QString &versionControlType)
{
foreach (IVersionControl * versionControl, allVersionControls()) {
if (versionControl->displayName() == versionControlType) {
if (versionControl->displayName() == versionControlType)
return true;
}
}
return false;
}
......
......@@ -101,7 +101,7 @@ QString CVSControl::vcsGetRepositoryURL(const QString &)
return QString();
}
bool CVSControl::vcsCheckout(const QString &/*directory*/, const QByteArray &/*url*/)
bool CVSControl::vcsCheckout(const QString &, const QByteArray &)
{
return false;
}
......
......@@ -1926,9 +1926,9 @@ QString GitClient::readConfigValue(const QString &workingDirectory, const QStrin
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()))
......@@ -1936,23 +1936,28 @@ bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
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;
......@@ -1960,7 +1965,8 @@ bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
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;
}
}
......@@ -1972,7 +1978,7 @@ QString GitClient::vcsGetRepositoryURL(const QString &directory)
arguments << QLatin1String("remote.origin.url");
if (fullySynchronousGit(directory,arguments,&outputText,0,false)) {
if (fullySynchronousGit(directory, arguments, &outputText, 0, false)) {
return commandOutputFromLocal8Bit(outputText);
}
return QString();
......
......@@ -158,7 +158,7 @@ public:
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);
......
......@@ -126,13 +126,13 @@ bool GitVersionControl::vcsCreateRepository(const QString &directory)
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);
}
......
......@@ -501,8 +501,9 @@ bool MercurialClient::clone(const QString &directory, const QString &url)
{
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
......
......@@ -130,12 +130,12 @@ bool PerforceVersionControl::vcsAnnotate(const QString &file, int line)
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();
}
......
......@@ -91,9 +91,9 @@ bool SubversionControl::vcsMove(const QString &from, const QString &to)
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)
......
......@@ -1243,13 +1243,14 @@ bool SubversionPlugin::vcsCheckout(const QString &directory, const QByteArray &u
// 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;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment