Commit 262f7f42 authored by Tobias Hunger's avatar Tobias Hunger

Vcs: Remove unused GetRepositoryRootOperation

Change-Id: I2443aef788c75a96ba19e2499dfb3f17c201d468
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent bafdf36f
......@@ -86,7 +86,6 @@ bool BazaarControl::supportsOperation(Operation operation) const
case Core::IVersionControl::MoveOperation:
case Core::IVersionControl::CreateRepositoryOperation:
case Core::IVersionControl::AnnotateOperation:
case Core::IVersionControl::GetRepositoryRootOperation:
break;
case Core::IVersionControl::SnapshotOperations:
supported = false;
......@@ -134,13 +133,6 @@ bool BazaarControl::vcsAnnotate(const QString &file, int line)
return true;
}
QString BazaarControl::vcsGetRepositoryURL(const QString &directory)
{
const QString repositoryRoot = m_bazaarClient->findTopLevelForFile(directory);
const BranchInfo branchInfo = m_bazaarClient->synchronousBranchQuery(repositoryRoot);
return branchInfo.isBoundToBranch ? branchInfo.branchLocation : QString();
}
void BazaarControl::changed(const QVariant &v)
{
switch (v.type()) {
......
......@@ -62,7 +62,6 @@ public:
bool vcsDelete(const QString &filename);
bool vcsMove(const QString &from, const QString &to);
bool vcsCreateRepository(const QString &directory);
QString vcsGetRepositoryURL(const QString &directory);
bool vcsAnnotate(const QString &file, int line);
public slots:
......
......@@ -77,7 +77,6 @@ bool ClearCaseControl::supportsOperation(Operation operation) const
case DeleteOperation:
case MoveOperation:
case AnnotateOperation:
case GetRepositoryRootOperation:
break;
case CreateRepositoryOperation:
case SnapshotOperations:
......@@ -139,11 +138,6 @@ bool ClearCaseControl::vcsMove(const QString &from, const QString &to)
return m_plugin->vcsMove(ifrom.absolutePath(), ifrom.fileName(), ito.fileName());
}
QString ClearCaseControl::vcsGetRepositoryURL(const QString &directory)
{
return m_plugin->vcsGetRepositoryURL(directory);
}
bool ClearCaseControl::managesDirectory(const QString &directory, QString *topLevel) const
{
return m_plugin->managesDirectory(directory, topLevel);
......
......@@ -61,7 +61,6 @@ public:
bool vcsDelete(const QString &filename);
bool vcsMove(const QString &from, const QString &to);
bool vcsCreateRepository(const QString &directory);
QString vcsGetRepositoryURL(const QString &directory);
bool vcsAnnotate(const QString &file, int line);
......
......@@ -1851,11 +1851,6 @@ bool ClearCasePlugin::vcsCheckout(const QString & /*directory*/, const QByteArra
return false;
}
QString ClearCasePlugin::vcsGetRepositoryURL(const QString & /*directory*/)
{
return currentState().topLevel();
}
///
/// Check if the directory is managed under ClearCase control.
///
......
......@@ -144,7 +144,6 @@ public:
bool vcsSetActivity(const QString &workingDir, const QString &title, const QString &activity);
bool managesDirectory(const QString &directory, QString *topLevel = 0) const;
bool vcsCheckout(const QString &directory, const QByteArray &url);
QString vcsGetRepositoryURL(const QString &directory);
static ClearCasePlugin *instance();
......
......@@ -56,9 +56,8 @@ public:
AddOperation, DeleteOperation, MoveOperation,
CreateRepositoryOperation,
SnapshotOperations,
AnnotateOperation,
GetRepositoryRootOperation
};
AnnotateOperation
};
enum OpenSupportMode {
NoOpen, /*!< Files can be edited without noticing the VCS */
......@@ -168,11 +167,6 @@ public:
*/
virtual bool vcsCreateRepository(const QString &directory) = 0;
/*!
* Called to get the version control repository root.
*/
virtual QString vcsGetRepositoryURL(const QString &directory) = 0;
/*!
* Topic (e.g. name of the current branch)
*/
......@@ -245,7 +239,6 @@ public:
bool vcsDelete(const QString &) { return false; }
bool vcsMove(const QString &, const QString &) { return false; }
bool vcsCreateRepository(const QString &) { return false; }
QString vcsGetRepositoryURL(const QString &) { return QString(); }
bool vcsAnnotate(const QString &, int) { return false; }
private:
......
......@@ -74,7 +74,6 @@ bool CvsControl::supportsOperation(Operation operation) const
case MoveOperation:
case CreateRepositoryOperation:
case SnapshotOperations:
case GetRepositoryRootOperation:
rc = false;
break;
}
......@@ -117,11 +116,6 @@ bool CvsControl::vcsCreateRepository(const QString &)
return false;
}
QString CvsControl::vcsGetRepositoryURL(const QString &)
{
return QString();
}
bool CvsControl::vcsAnnotate(const QString &file, int line)
{
const QFileInfo fi(file);
......
......@@ -59,7 +59,6 @@ public:
bool vcsDelete(const QString &filename);
bool vcsMove(const QString &from, const QString &to);
bool vcsCreateRepository(const QString &directory);
QString vcsGetRepositoryURL(const QString &directory);
bool vcsAnnotate(const QString &file, int line);
QString vcsOpenText() const;
......
......@@ -3472,20 +3472,6 @@ bool GitClient::cloneRepository(const QString &directory,const QByteArray &url)
}
}
QString GitClient::vcsGetRepositoryURL(const QString &directory)
{
QStringList arguments(QLatin1String("config"));
QByteArray outputText;
arguments << QLatin1String("remote.origin.url");
if (fullySynchronousGit(directory, arguments, &outputText, 0,
VcsBasePlugin::SuppressCommandLogging)) {
return commandOutputFromLocal8Bit(outputText);
}
return QString();
}
GitSettings *GitClient::settings() const
{
return m_settings;
......
......@@ -253,7 +253,6 @@ public:
bool isFastForwardMerge(const QString &workingDirectory, const QString &branch);
bool cloneRepository(const QString &directory, const QByteArray &url);
QString vcsGetRepositoryURL(const QString &directory);
void fetch(const QString &workingDirectory, const QString &remote);
bool synchronousPull(const QString &workingDirectory, bool rebase);
void push(const QString &workingDirectory, const QStringList &pushArgs = QStringList());
......
......@@ -98,7 +98,6 @@ bool GitVersionControl::supportsOperation(Operation operation) const
case CreateRepositoryOperation:
case SnapshotOperations:
case AnnotateOperation:
case GetRepositoryRootOperation:
return true;
}
return false;
......@@ -133,11 +132,6 @@ bool GitVersionControl::vcsCreateRepository(const QString &directory)
return m_client->synchronousInit(directory);
}
QString GitVersionControl::vcsGetRepositoryURL(const QString &directory)
{
return m_client->vcsGetRepositoryURL(directory);
}
QString GitVersionControl::vcsTopic(const QString &directory)
{
QString topic = Core::IVersionControl::vcsTopic(directory);
......
......@@ -58,7 +58,6 @@ public:
bool vcsDelete(const QString &filename);
bool vcsMove(const QString &from, const QString &to);
bool vcsCreateRepository(const QString &directory);
QString vcsGetRepositoryURL(const QString &directory);
bool vcsAnnotate(const QString &file, int line);
QString vcsTopic(const QString &directory);
......
......@@ -251,18 +251,6 @@ QString MercurialClient::shortDescriptionSync(const QString &workingDirectory,
return shortDescriptionSync(workingDirectory, revision, QLatin1String(defaultFormatC));
}
QString MercurialClient::vcsGetRepositoryURL(const QString &directory)
{
QByteArray output;
QStringList arguments(QLatin1String("showconfig"));
arguments << QLatin1String("paths.default");
if (vcsFullySynchronousExec(directory, arguments, &output))
return QString::fromLocal8Bit(output);
return QString();
}
bool MercurialClient::managesFile(const QString &workingDirectory, const QString &fileName) const
{
QStringList args;
......
......@@ -63,7 +63,6 @@ public:
QString shortDescriptionSync(const QString &workingDirectory, const QString &revision);
void incoming(const QString &repositoryRoot, const QString &repository = QString());
void outgoing(const QString &repositoryRoot);
QString vcsGetRepositoryURL(const QString &directory);
bool managesFile(const QString &workingDirectory, const QString &fileName) const;
void annotate(const QString &workingDir, const QString &file,
......
......@@ -112,7 +112,6 @@ bool MercurialControl::supportsOperation(Operation operation) const
case Core::IVersionControl::MoveOperation:
case Core::IVersionControl::CreateRepositoryOperation:
case Core::IVersionControl::AnnotateOperation:
case Core::IVersionControl::GetRepositoryRootOperation:
break;
case Core::IVersionControl::SnapshotOperations:
supported = false;
......@@ -171,11 +170,6 @@ bool MercurialControl::sccManaged(const QString &filename)
return mercurialClient->manifestSync(topLevel, topLevelDir.relativeFilePath(filename));
}
QString MercurialControl::vcsGetRepositoryURL(const QString &directory)
{
return mercurialClient->vcsGetRepositoryURL(directory);
}
void MercurialControl::changed(const QVariant &v)
{
switch (v.type()) {
......
......@@ -62,7 +62,6 @@ public:
bool vcsDelete(const QString &filename);
bool vcsMove(const QString &from, const QString &to);
bool vcsCreateRepository(const QString &directory);
QString vcsGetRepositoryURL(const QString &directory);
bool sccManaged(const QString &filename);
bool vcsAnnotate(const QString &file, int line);
......
......@@ -76,7 +76,6 @@ bool PerforceVersionControl::supportsOperation(Operation operation) const
return supported;
case CreateRepositoryOperation:
case SnapshotOperations:
case GetRepositoryRootOperation:
break;
}
return false;
......@@ -133,11 +132,6 @@ bool PerforceVersionControl::vcsAnnotate(const QString &file, int line)
return true;
}
QString PerforceVersionControl::vcsGetRepositoryURL(const QString &)
{
return QString();
}
QString PerforceVersionControl::vcsOpenText() const
{
return tr("&Edit");
......
......@@ -59,7 +59,6 @@ public:
bool vcsDelete(const QString &filename);
bool vcsMove(const QString &from, const QString &to);
bool vcsCreateRepository(const QString &directory);
QString vcsGetRepositoryURL(const QString &directory);
bool vcsAnnotate(const QString &file, int line);
QString vcsOpenText() const;
QString vcsMakeWritableText() const;
......
......@@ -93,7 +93,6 @@ bool SubversionControl::supportsOperation(Operation operation) const
case DeleteOperation:
case MoveOperation:
case AnnotateOperation:
case GetRepositoryRootOperation:
break;
case CreateRepositoryOperation:
case SnapshotOperations:
......@@ -128,11 +127,6 @@ bool SubversionControl::vcsMove(const QString &from, const QString &to)
return m_plugin->vcsMove(fromInfo.absolutePath(), fromInfo.absoluteFilePath(), toInfo.absoluteFilePath());
}
QString SubversionControl::vcsGetRepositoryURL(const QString &directory)
{
return m_plugin->vcsGetRepositoryURL(directory);
}
bool SubversionControl::vcsCreateRepository(const QString &)
{
return false;
......
......@@ -57,7 +57,6 @@ public:
bool vcsDelete(const QString &filename);
bool vcsMove(const QString &from, const QString &to);
bool vcsCreateRepository(const QString &directory);
QString vcsGetRepositoryURL(const QString &directory);
bool vcsAnnotate(const QString &file, int line);
......
......@@ -1104,45 +1104,6 @@ bool SubversionPlugin::vcsCheckout(const QString &directory, const QByteArray &u
}
QString SubversionPlugin::vcsGetRepositoryURL(const QString &directory)
{
QXmlStreamReader xml;
QStringList args = QStringList(QLatin1String("info"));
args << SubversionClient::addAuthenticationOptions(settings()) << QLatin1String("--xml");
const SubversionResponse response = runSvn(directory, args, 10 * m_settings.timeOutMs(), SuppressCommandLogging);
xml.addData(response.stdOut);
bool repo = false;
bool root = false;
while (!xml.atEnd() && !xml.hasError()) {
switch (xml.readNext()) {
case QXmlStreamReader::StartDocument:
break;
case QXmlStreamReader::StartElement:
if (xml.name() == QLatin1String("repository"))
repo = true;
else if (repo && xml.name() == QLatin1String("root"))
root = true;
break;
case QXmlStreamReader::EndElement:
if (xml.name() == QLatin1String("repository"))
repo = false;
else if (repo && xml.name() == QLatin1String("root"))
root = false;
break;
case QXmlStreamReader::Characters:
if (repo && root)
return xml.text().toString();
break;
default:
break;
}
}
return QString();
}
bool SubversionPlugin::managesDirectory(const QString &directory, QString *topLevel /* = 0 */) const
{
const QDir dir(directory);
......
......@@ -87,7 +87,6 @@ public:
bool managesDirectory(const QString &directory, QString *topLevel = 0) const;
bool managesFile(const QString &workingDirectory, const QString &fileName) const;
bool vcsCheckout(const QString &directory, const QByteArray &url);
QString vcsGetRepositoryURL(const QString &directory);
static SubversionPlugin *instance();
......
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