Commit 63cf15b1 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Git: Start interactive rebase in topLevel



Change-Id: I99edfed36b12942e64ee1947a46eddd1ca08b9ba
Reviewed-by: default avatarPetar Perisin <petar.perisin@gmail.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 2ee83d4c
......@@ -788,17 +788,19 @@ void GitPlugin::resetRepository()
void GitPlugin::startRebase()
{
QString workingDirectory = currentState().currentDirectoryOrTopLevel();
if (workingDirectory.isEmpty() || !m_gitClient->canRebase(workingDirectory))
const VcsBase::VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return);
const QString topLevel = state.topLevel();
if (topLevel.isEmpty() || !m_gitClient->canRebase(topLevel))
return;
if (!m_gitClient->beginStashScope(workingDirectory, QLatin1String("Rebase-i")))
if (!m_gitClient->beginStashScope(topLevel, QLatin1String("Rebase-i")))
return;
LogChangeDialog dialog(false);
dialog.setWindowTitle(tr("Interactive Rebase"));
if (dialog.runDialog(workingDirectory, QString(), false))
m_gitClient->interactiveRebase(workingDirectory, dialog.commit(), false);
if (dialog.runDialog(topLevel, QString(), false))
m_gitClient->interactiveRebase(topLevel, dialog.commit(), false);
else
m_gitClient->endStashScope(workingDirectory);
m_gitClient->endStashScope(topLevel);
}
void GitPlugin::startChangeRelatedAction()
......
......@@ -405,15 +405,6 @@ QString VcsBasePluginState::topLevel() const
return hasFile() ? data->m_state.currentFileTopLevel : data->m_state.currentProjectTopLevel;
}
QString VcsBasePluginState::currentDirectoryOrTopLevel() const
{
if (hasFile())
return data->m_state.currentFileDirectory;
else if (data->m_state.hasProject())
return data->m_state.currentProjectTopLevel;
return QString();
}
bool VcsBasePluginState::equals(const Internal::State &rhs) const
{
return data->m_state.equals(rhs);
......
......@@ -102,7 +102,6 @@ public:
// the file one.
QString topLevel() const;
QString currentDirectoryOrTopLevel() const;
bool equals(const VcsBasePluginState &rhs) const;
friend VCSBASE_EXPORT QDebug operator<<(QDebug in, const VcsBasePluginState &state);
......
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