forked from qt-creator/qt-creator
Git: Mark forgotten cases as expected to change
* When mergetool is done * Stash * Stash pop * Continue/skip command * executeAndHandleConflicts * Interactive rebase Change-Id: Ic8108b096c367c7777dae06f7ff255999d64fda9 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
0bd5e79bc7
commit
879012a50b
@@ -1431,7 +1431,8 @@ bool GitClient::synchronousCheckoutFiles(const QString &workingDirectory,
|
|||||||
if (revertStaging)
|
if (revertStaging)
|
||||||
arguments << revision;
|
arguments << revision;
|
||||||
arguments << QLatin1String("--") << files;
|
arguments << QLatin1String("--") << files;
|
||||||
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText);
|
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText,
|
||||||
|
VcsBasePlugin::ExpectRepoChanges);
|
||||||
if (!rc) {
|
if (!rc) {
|
||||||
const QString fileArg = files.join(QLatin1String(", "));
|
const QString fileArg = files.join(QLatin1String(", "));
|
||||||
//: Meaning of the arguments: %1: revision, %2: files, %3: repository,
|
//: Meaning of the arguments: %1: revision, %2: files, %3: repository,
|
||||||
@@ -1837,7 +1838,8 @@ bool GitClient::executeSynchronousStash(const QString &workingDirectory,
|
|||||||
arguments << QLatin1String("stash");
|
arguments << QLatin1String("stash");
|
||||||
if (!message.isEmpty())
|
if (!message.isEmpty())
|
||||||
arguments << QLatin1String("save") << message;
|
arguments << QLatin1String("save") << message;
|
||||||
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText);
|
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText,
|
||||||
|
VcsBasePlugin::ExpectRepoChanges);
|
||||||
if (!rc) {
|
if (!rc) {
|
||||||
const QString msg = tr("Cannot stash in \"%1\": %2").
|
const QString msg = tr("Cannot stash in \"%1\": %2").
|
||||||
arg(QDir::toNativeSeparators(workingDirectory),
|
arg(QDir::toNativeSeparators(workingDirectory),
|
||||||
@@ -2849,9 +2851,7 @@ bool GitClient::executeAndHandleConflicts(const QString &workingDirectory,
|
|||||||
ConflictHandler conflictHandler(0, workingDirectory, abortCommand);
|
ConflictHandler conflictHandler(0, workingDirectory, abortCommand);
|
||||||
// Notify about changed files or abort the rebase.
|
// Notify about changed files or abort the rebase.
|
||||||
const bool ok = resp.result == Utils::SynchronousProcessResponse::Finished;
|
const bool ok = resp.result == Utils::SynchronousProcessResponse::Finished;
|
||||||
if (ok) {
|
if (!ok) {
|
||||||
GitPlugin::instance()->gitVersionControl()->emitRepositoryChanged(workingDirectory);
|
|
||||||
} else {
|
|
||||||
conflictHandler.readStdOutString(resp.stdOut);
|
conflictHandler.readStdOutString(resp.stdOut);
|
||||||
conflictHandler.readStdErr(resp.stdErr);
|
conflictHandler.readStdErr(resp.stdErr);
|
||||||
}
|
}
|
||||||
@@ -2951,10 +2951,7 @@ void GitClient::synchronousSubversionFetch(const QString &workingDirectory)
|
|||||||
// Disable UNIX terminals to suppress SSH prompting.
|
// Disable UNIX terminals to suppress SSH prompting.
|
||||||
const unsigned flags = VcsBasePlugin::SshPasswordPrompt|VcsBasePlugin::ShowStdOutInLogWindow
|
const unsigned flags = VcsBasePlugin::SshPasswordPrompt|VcsBasePlugin::ShowStdOutInLogWindow
|
||||||
|VcsBasePlugin::ShowSuccessMessage;
|
|VcsBasePlugin::ShowSuccessMessage;
|
||||||
const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, args, flags);
|
synchronousGit(workingDirectory, args, flags);
|
||||||
// Notify about changes.
|
|
||||||
if (resp.result == Utils::SynchronousProcessResponse::Finished)
|
|
||||||
GitPlugin::instance()->gitVersionControl()->emitRepositoryChanged(workingDirectory);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitClient::subversionLog(const QString &workingDirectory)
|
void GitClient::subversionLog(const QString &workingDirectory)
|
||||||
@@ -3095,7 +3092,8 @@ bool GitClient::synchronousStashRestore(const QString &workingDirectory,
|
|||||||
arguments << QLatin1String("branch") << branch << stash;
|
arguments << QLatin1String("branch") << branch << stash;
|
||||||
QByteArray outputText;
|
QByteArray outputText;
|
||||||
QByteArray errorText;
|
QByteArray errorText;
|
||||||
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText);
|
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText,
|
||||||
|
VcsBasePlugin::ExpectRepoChanges);
|
||||||
if (!rc) {
|
if (!rc) {
|
||||||
const QString stdErr = commandOutputFromLocal8Bit(errorText);
|
const QString stdErr = commandOutputFromLocal8Bit(errorText);
|
||||||
const QString nativeWorkingDir = QDir::toNativeSeparators(workingDirectory);
|
const QString nativeWorkingDir = QDir::toNativeSeparators(workingDirectory);
|
||||||
@@ -3113,7 +3111,6 @@ bool GitClient::synchronousStashRestore(const QString &workingDirectory,
|
|||||||
QString output = commandOutputFromLocal8Bit(outputText);
|
QString output = commandOutputFromLocal8Bit(outputText);
|
||||||
if (!output.isEmpty())
|
if (!output.isEmpty())
|
||||||
outputWindow()->append(output);
|
outputWindow()->append(output);
|
||||||
GitPlugin::instance()->gitVersionControl()->emitRepositoryChanged(workingDirectory);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,7 +30,9 @@
|
|||||||
#include "mergetool.h"
|
#include "mergetool.h"
|
||||||
#include "gitclient.h"
|
#include "gitclient.h"
|
||||||
#include "gitplugin.h"
|
#include "gitplugin.h"
|
||||||
|
#include "gitversioncontrol.h"
|
||||||
|
|
||||||
|
#include <coreplugin/documentmanager.h>
|
||||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -100,6 +102,7 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files)
|
|||||||
if (m_process->waitForStarted()) {
|
if (m_process->waitForStarted()) {
|
||||||
connect(m_process, SIGNAL(finished(int)), this, SLOT(done()));
|
connect(m_process, SIGNAL(finished(int)), this, SLOT(done()));
|
||||||
connect(m_process, SIGNAL(readyRead()), this, SLOT(readData()));
|
connect(m_process, SIGNAL(readyRead()), this, SLOT(readData()));
|
||||||
|
Core::DocumentManager::expectDirectoryChange(workingDirectory);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
delete m_process;
|
delete m_process;
|
||||||
@@ -257,13 +260,16 @@ void MergeTool::readData()
|
|||||||
void MergeTool::done()
|
void MergeTool::done()
|
||||||
{
|
{
|
||||||
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
|
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
|
||||||
|
const QString workingDirectory = m_process->workingDirectory();
|
||||||
int exitCode = m_process->exitCode();
|
int exitCode = m_process->exitCode();
|
||||||
if (!exitCode) {
|
if (!exitCode) {
|
||||||
outputWindow->append(tr("Merge tool process finished successully."));
|
outputWindow->append(tr("Merge tool process finished successully."));
|
||||||
m_gitClient->continueCommandIfNeeded(m_process->workingDirectory());
|
m_gitClient->continueCommandIfNeeded(workingDirectory);
|
||||||
} else {
|
} else {
|
||||||
outputWindow->append(tr("Merge tool process terminated with exit code %1").arg(exitCode));
|
outputWindow->append(tr("Merge tool process terminated with exit code %1").arg(exitCode));
|
||||||
}
|
}
|
||||||
|
Core::DocumentManager::unexpectDirectoryChange(workingDirectory);
|
||||||
|
GitPlugin::instance()->gitVersionControl()->emitRepositoryChanged(workingDirectory);
|
||||||
deleteLater();
|
deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user