Mercurial plugin, merge request with suggested fixes.

This commit is contained in:
Brian McGillion
2009-09-15 13:03:13 +03:00
parent 0915342d15
commit 989e1b5acf
42 changed files with 3504 additions and 3 deletions

View File

@@ -0,0 +1,80 @@
#include "mercurialcontrol.h"
#include "mercurialclient.h"
#include <QtCore/QFileInfo>
using namespace Mercurial::Internal;
MercurialControl::MercurialControl(MercurialClient *client)
: mercurialClient(client),
mercurialEnabled(true)
{
}
QString MercurialControl::name() const
{
return tr("Mercurial");
}
bool MercurialControl::isEnabled() const
{
return mercurialEnabled;
}
void MercurialControl::setEnabled(bool enabled)
{
if (mercurialEnabled != enabled) {
mercurialEnabled = enabled;
emit enabledChanged(mercurialEnabled);
}
}
bool MercurialControl::managesDirectory(const QString &directory) const
{
QFileInfo dir(directory);
return !mercurialClient->findTopLevelForFile(dir).isEmpty();
}
QString MercurialControl::findTopLevelForDirectory(const QString &directory) const
{
QFileInfo dir(directory);
return mercurialClient->findTopLevelForFile(dir);
}
bool MercurialControl::supportsOperation(Operation operation) const
{
bool supported = true;
switch (operation) {
case Core::IVersionControl::AddOperation:
case Core::IVersionControl::DeleteOperation:
break;
case Core::IVersionControl::OpenOperation:
default:
supported = false;
break;
}
return supported;
}
bool MercurialControl::vcsOpen(const QString &filename)
{
Q_UNUSED(filename)
return true;
}
bool MercurialControl::vcsAdd(const QString &filename)
{
return mercurialClient->add(filename);
}
bool MercurialControl::vcsDelete(const QString &filename)
{
return mercurialClient->remove(filename);
}
bool MercurialControl::sccManaged(const QString &filename)
{
return mercurialClient->manifestSync(filename);
}