forked from qt-creator/qt-creator
Implement unified diff editor
Change-Id: I93e0bfd71a8a650afbe2ca9e0f1f3dbfc9d57db0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
This commit is contained in:
@@ -310,7 +310,7 @@ void BranchDialog::diff()
|
||||
if (fullName.isEmpty())
|
||||
return;
|
||||
// Do not pass working dir by reference since it might change
|
||||
GitPlugin::instance()->gitClient()->diffBranch(QString(m_repository), QStringList(), fullName);
|
||||
GitPlugin::instance()->gitClient()->diffBranch(QString(m_repository), fullName);
|
||||
}
|
||||
|
||||
void BranchDialog::log()
|
||||
|
||||
@@ -246,7 +246,7 @@ void FetchContext::show()
|
||||
{
|
||||
const QString title = QString::number(m_change->number) + QLatin1Char('/')
|
||||
+ QString::number(m_change->currentPatchSet.patchSetNumber);
|
||||
gitClient()->show(m_repository, QLatin1String("FETCH_HEAD"), QStringList(), title);
|
||||
gitClient()->show(m_repository, QLatin1String("FETCH_HEAD"), title);
|
||||
}
|
||||
|
||||
void FetchContext::cherryPick()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -45,6 +45,7 @@ class QCheckBox;
|
||||
class QSignalMapper;
|
||||
class QDebug;
|
||||
class QProcessEnvironment;
|
||||
class QMenu;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core { class ICore; }
|
||||
@@ -58,7 +59,10 @@ namespace VcsBase {
|
||||
|
||||
namespace Utils { struct SynchronousProcessResponse; }
|
||||
|
||||
namespace DiffEditor { class DiffEditorDocument; }
|
||||
namespace DiffEditor {
|
||||
class DiffEditorDocument;
|
||||
class DiffEditorController;
|
||||
}
|
||||
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
@@ -141,7 +145,6 @@ public:
|
||||
const QStringList &unstagedFileNames,
|
||||
const QStringList &stagedFileNames = QStringList());
|
||||
void diffBranch(const QString &workingDirectory,
|
||||
const QStringList &diffArgs,
|
||||
const QString &branchName);
|
||||
void merge(const QString &workingDirectory, const QStringList &unmergedFileNames = QStringList());
|
||||
|
||||
@@ -332,7 +335,6 @@ public:
|
||||
public slots:
|
||||
void show(const QString &source,
|
||||
const QString &id,
|
||||
const QStringList &args = QStringList(),
|
||||
const QString &name = QString());
|
||||
void saveSettings();
|
||||
|
||||
@@ -341,8 +343,13 @@ private slots:
|
||||
QString change, int lineNumber);
|
||||
void finishSubmoduleUpdate();
|
||||
void fetchFinished(const QVariant &cookie);
|
||||
void slotChunkActionsRequested(QMenu *menu, int diffFileIndex, int chunkIndex);
|
||||
void slotStageChunk();
|
||||
void slotUnstageChunk();
|
||||
|
||||
private:
|
||||
QString makePatch(int diffFileIndex, int chunkIndex, bool revert) const;
|
||||
void stage(const QString &patch, bool revert);
|
||||
QByteArray readConfigBytes(const QString &workingDirectory, const QString &configVar) const;
|
||||
QTextCodec *getSourceCodec(const QString &file) const;
|
||||
VcsBase::VcsBaseEditorWidget *findExistingVCSEditor(const char *registerDynamicProperty,
|
||||
@@ -421,6 +428,9 @@ private:
|
||||
QMap<QString, StashInfo> m_stashInfo;
|
||||
QStringList m_updatedSubmodules;
|
||||
bool m_disableEditor;
|
||||
int m_contextDiffFileIndex;
|
||||
int m_contextChunkIndex;
|
||||
QPointer<DiffEditor::DiffEditorController> m_contextDocument;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
namespace Git {
|
||||
namespace Internal {
|
||||
|
||||
const QLatin1String GitSettings::useDiffEditorKey("UseDiffEditor");
|
||||
const QLatin1String GitSettings::pullRebaseKey("PullRebase");
|
||||
const QLatin1String GitSettings::showTagsKey("ShowTags");
|
||||
const QLatin1String GitSettings::omitAnnotationDateKey("OmitAnnotationDate");
|
||||
@@ -56,7 +55,6 @@ GitSettings::GitSettings()
|
||||
|
||||
declareKey(binaryPathKey, QLatin1String("git"));
|
||||
declareKey(timeoutKey, Utils::HostOsInfo::isWindowsHost() ? 60 : 30);
|
||||
declareKey(useDiffEditorKey, true);
|
||||
declareKey(pullRebaseKey, false);
|
||||
declareKey(showTagsKey, false);
|
||||
declareKey(omitAnnotationDateKey, false);
|
||||
|
||||
@@ -48,7 +48,6 @@ class GitSettings : public VcsBase::VcsBaseClientSettings
|
||||
public:
|
||||
GitSettings();
|
||||
|
||||
static const QLatin1String useDiffEditorKey;
|
||||
static const QLatin1String pullRebaseKey;
|
||||
static const QLatin1String showTagsKey;
|
||||
static const QLatin1String omitAnnotationDateKey;
|
||||
|
||||
Reference in New Issue
Block a user