forked from qt-creator/qt-creator
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:
@@ -43,6 +43,8 @@ static const char submitMessageCheckScriptKeyC[] = "SubmitMessageCheckScript";
|
||||
static const char lineWrapKeyC[] = "LineWrap";
|
||||
static const char lineWrapWidthKeyC[] = "LineWrapWidth";
|
||||
static const char sshPasswordPromptKeyC[] = "SshPasswordPrompt";
|
||||
static const char patchCommandKeyC[] = "PatchCommand";
|
||||
static const char patchCommandDefaultC[] = "patch";
|
||||
|
||||
static const int lineWrapWidthDefault = 72;
|
||||
static const bool lineWrapDefault = true;
|
||||
@@ -65,6 +67,7 @@ namespace Internal {
|
||||
|
||||
CommonVcsSettings::CommonVcsSettings() :
|
||||
sshPasswordPrompt(sshPasswordPromptDefault()),
|
||||
patchCommand(QLatin1String(patchCommandDefaultC)),
|
||||
lineWrap(lineWrapDefault),
|
||||
lineWrapWidth(lineWrapWidthDefault)
|
||||
{
|
||||
@@ -78,6 +81,7 @@ void CommonVcsSettings::toSettings(QSettings *s) const
|
||||
s->setValue(QLatin1String(submitMessageCheckScriptKeyC), submitMessageCheckScript);
|
||||
s->setValue(QLatin1String(lineWrapKeyC), lineWrap);
|
||||
s->setValue(QLatin1String(lineWrapWidthKeyC), lineWrapWidth);
|
||||
s->setValue(QLatin1String(patchCommandKeyC), patchCommand);
|
||||
// Do not store the default setting to avoid clobbering the environment.
|
||||
if (sshPasswordPrompt != sshPasswordPromptDefault()) {
|
||||
s->setValue(QLatin1String(sshPasswordPromptKeyC), sshPasswordPrompt);
|
||||
@@ -96,6 +100,7 @@ void CommonVcsSettings::fromSettings(QSettings *s)
|
||||
lineWrap = s->value(QLatin1String(lineWrapKeyC), lineWrapDefault).toBool();
|
||||
lineWrapWidth = s->value(QLatin1String(lineWrapWidthKeyC), lineWrapWidthDefault).toInt();
|
||||
sshPasswordPrompt = s->value(QLatin1String(sshPasswordPromptKeyC), sshPasswordPromptDefault()).toString();
|
||||
patchCommand = s->value(QLatin1String(patchCommandKeyC), QLatin1String(patchCommandDefaultC)).toString();
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
@@ -106,7 +111,8 @@ bool CommonVcsSettings::equals(const CommonVcsSettings &rhs) const
|
||||
&& nickNameMailMap == rhs.nickNameMailMap
|
||||
&& nickNameFieldListFile == rhs.nickNameFieldListFile
|
||||
&& submitMessageCheckScript == rhs.submitMessageCheckScript
|
||||
&& sshPasswordPrompt == rhs.sshPasswordPrompt;
|
||||
&& sshPasswordPrompt == rhs.sshPasswordPrompt
|
||||
&& patchCommand == rhs.patchCommand;
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug d,const CommonVcsSettings& s)
|
||||
@@ -117,6 +123,7 @@ QDebug operator<<(QDebug d,const CommonVcsSettings& s)
|
||||
<< "' nickNameFieldListFile='" << s.nickNameFieldListFile
|
||||
<< "'submitMessageCheckScript='" << s.submitMessageCheckScript
|
||||
<< "'sshPasswordPrompt='" << s.sshPasswordPrompt
|
||||
<< "'patchCommand='" << s.patchCommand
|
||||
<< "'\n";
|
||||
return d;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user