Vcs: Remove snapshot support

The functionality is unused.

Change-Id: I45017106509b8dbff9f3eff3aaef6de19be31ce7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tobias Hunger
2013-10-14 15:38:00 +02:00
parent fe47725ae6
commit 741ab2cbfb
18 changed files with 4 additions and 351 deletions

View File

@@ -500,8 +500,9 @@ VCSBASE_EXPORT QDebug operator<<(QDebug in, const VcsBasePluginState &state)
the virtual submitEditorAboutToClose() to trigger the submit process.
*/
struct VcsBasePluginPrivate
class VcsBasePluginPrivate
{
public:
explicit VcsBasePluginPrivate();
inline bool supportsRepositoryCreation() const;
@@ -510,22 +511,13 @@ struct VcsBasePluginPrivate
Core::IVersionControl *m_versionControl;
VcsBasePluginState m_state;
int m_actionState;
QAction *m_testSnapshotAction;
QAction *m_testListSnapshotsAction;
QAction *m_testRestoreSnapshotAction;
QAction *m_testRemoveSnapshotAction;
QString m_testLastSnapshot;
static Internal::StateListener *m_listener;
};
VcsBasePluginPrivate::VcsBasePluginPrivate() :
m_versionControl(0),
m_actionState(-1),
m_testSnapshotAction(0),
m_testListSnapshotsAction(0),
m_testRestoreSnapshotAction(0),
m_testRemoveSnapshotAction(0)
m_actionState(-1)
{
}
@@ -710,62 +702,6 @@ bool VcsBasePlugin::raiseSubmitEditor() const
return true;
}
// For internal tests: Create actions driving IVersionControl's snapshot interface.
QList<QAction*> VcsBasePlugin::createSnapShotTestActions()
{
if (!d->m_testSnapshotAction) {
d->m_testSnapshotAction = new QAction(QLatin1String("Take snapshot"), this);
connect(d->m_testSnapshotAction, SIGNAL(triggered()), this, SLOT(slotTestSnapshot()));
d->m_testListSnapshotsAction = new QAction(QLatin1String("List snapshots"), this);
connect(d->m_testListSnapshotsAction, SIGNAL(triggered()), this, SLOT(slotTestListSnapshots()));
d->m_testRestoreSnapshotAction = new QAction(QLatin1String("Restore snapshot"), this);
connect(d->m_testRestoreSnapshotAction, SIGNAL(triggered()), this, SLOT(slotTestRestoreSnapshot()));
d->m_testRemoveSnapshotAction = new QAction(QLatin1String("Remove snapshot"), this);
connect(d->m_testRemoveSnapshotAction, SIGNAL(triggered()), this, SLOT(slotTestRemoveSnapshot()));
}
QList<QAction*> rc;
rc << d->m_testSnapshotAction << d->m_testListSnapshotsAction << d->m_testRestoreSnapshotAction
<< d->m_testRemoveSnapshotAction;
return rc;
}
void VcsBasePlugin::slotTestSnapshot()
{
QTC_ASSERT(currentState().hasTopLevel(), return);
d->m_testLastSnapshot = versionControl()->vcsCreateSnapshot(currentState().topLevel());
qDebug() << "Snapshot " << d->m_testLastSnapshot;
VcsBaseOutputWindow::instance()->append(QLatin1String("Snapshot: ") + d->m_testLastSnapshot);
if (!d->m_testLastSnapshot.isEmpty())
d->m_testRestoreSnapshotAction->setText(QLatin1String("Restore snapshot ") + d->m_testLastSnapshot);
}
void VcsBasePlugin::slotTestListSnapshots()
{
QTC_ASSERT(currentState().hasTopLevel(), return);
const QStringList snapshots = versionControl()->vcsSnapshots(currentState().topLevel());
qDebug() << "Snapshots " << snapshots;
VcsBaseOutputWindow::instance()->append(QLatin1String("Snapshots: ") + snapshots.join(QLatin1String(", ")));
}
void VcsBasePlugin::slotTestRestoreSnapshot()
{
QTC_ASSERT(currentState().hasTopLevel() && !d->m_testLastSnapshot.isEmpty(), return);
const bool ok = versionControl()->vcsRestoreSnapshot(currentState().topLevel(), d->m_testLastSnapshot);
const QString msg = d->m_testLastSnapshot+ (ok ? QLatin1String(" restored") : QLatin1String(" failed"));
qDebug() << msg;
VcsBaseOutputWindow::instance()->append(msg);
}
void VcsBasePlugin::slotTestRemoveSnapshot()
{
QTC_ASSERT(currentState().hasTopLevel() && !d->m_testLastSnapshot.isEmpty(), return);
const bool ok = versionControl()->vcsRemoveSnapshot(currentState().topLevel(), d->m_testLastSnapshot);
const QString msg = d->m_testLastSnapshot+ (ok ? QLatin1String(" removed") : QLatin1String(" failed"));
qDebug() << msg;
VcsBaseOutputWindow::instance()->append(msg);
d->m_testLastSnapshot.clear();
}
// Find top level for version controls like git/Mercurial that have
// a directory at the top of the repository.
// Note that checking for the existence of files is preferred over directories