VCS[git]: Add 'Revert this chunk' context menu option to diff view.

Implement in git. Add infrastructure to revert single chhunks
by using patch -R. Currently only implemented in git since
only that has functionality to re-run diff.

Rubber-stamped-by: hunger <tobias.hunger@nokia.com>
This commit is contained in:
Friedemann Kleint
2011-03-24 15:44:39 +01:00
parent fbe9925d8c
commit 491a27163a
10 changed files with 251 additions and 21 deletions

View File

@@ -58,6 +58,10 @@ CommonSettingsWidget::CommonSettingsWidget(QWidget *parent) :
m_ui->nickNameFieldsFileChooser->setExpectedKind(Utils::PathChooser::File);
m_ui->nickNameMailMapChooser->setExpectedKind(Utils::PathChooser::File);
m_ui->sshPromptChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
const QString patchToolTip = tr("Command used for reverting diff chunks");
m_ui->patchCommandLabel->setToolTip(patchToolTip);
m_ui->patchChooser->setToolTip(patchToolTip);
m_ui->patchChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
}
CommonSettingsWidget::~CommonSettingsWidget()
@@ -74,6 +78,7 @@ CommonVcsSettings CommonSettingsWidget::settings() const
rc.lineWrap= m_ui->lineWrapCheckBox->isChecked();
rc.lineWrapWidth = m_ui->lineWrapSpinBox->value();
rc.sshPasswordPrompt = m_ui->sshPromptChooser->path();
rc.patchCommand = m_ui->patchChooser->path();
return rc;
}
@@ -85,6 +90,7 @@ void CommonSettingsWidget::setSettings(const CommonVcsSettings &s)
m_ui->lineWrapCheckBox->setChecked(s.lineWrap);
m_ui->lineWrapSpinBox->setValue(s.lineWrapWidth);
m_ui->sshPromptChooser->setPath(s.sshPasswordPrompt);
m_ui->patchChooser->setPath(s.patchCommand);
}
QString CommonSettingsWidget::searchKeyWordMatchString() const