forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.0'
Conflicts: share/qtcreator/debugger/gdbbridge.py Change-Id: I32d8158c475f927b50ef06fde9ab8189ebdbcbbc
This commit is contained in:
@@ -380,9 +380,8 @@ void BranchModel::setCurrentBranch()
|
||||
BranchNode *local = m_rootNode->children.at(LocalBranches);
|
||||
int pos = 0;
|
||||
for (pos = 0; pos < local->count(); ++pos) {
|
||||
if (local->children.at(pos)->name == currentBranch) {
|
||||
if (local->children.at(pos)->name == currentBranch)
|
||||
m_currentBranch = local->children[pos];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -539,9 +539,8 @@ QString GitDiffHandler::workingTreeContents(const QString &fileName) const
|
||||
QString absoluteFileName = workingDir.absoluteFilePath(fileName);
|
||||
|
||||
QFile file(absoluteFileName);
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
return m_editor->editorWidget()->codec()->toUnicode(file.readAll());
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
@@ -3597,26 +3596,14 @@ void GitClient::stashPop(const QString &workingDirectory)
|
||||
bool GitClient::synchronousStashRestore(const QString &workingDirectory,
|
||||
const QString &stash,
|
||||
bool pop,
|
||||
const QString &branch /* = QString()*/,
|
||||
QString *errorMessage)
|
||||
const QString &branch /* = QString()*/)
|
||||
{
|
||||
QStringList arguments(QLatin1String("stash"));
|
||||
if (branch.isEmpty())
|
||||
arguments << QLatin1String(pop ? "pop" : "apply") << stash;
|
||||
else
|
||||
arguments << QLatin1String("branch") << branch << stash;
|
||||
QByteArray outputText;
|
||||
QByteArray errorText;
|
||||
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText,
|
||||
VcsBasePlugin::ExpectRepoChanges);
|
||||
if (rc) {
|
||||
const QString output = commandOutputFromLocal8Bit(outputText);
|
||||
if (!output.isEmpty())
|
||||
outputWindow()->append(output);
|
||||
} else {
|
||||
msgCannotRun(arguments, workingDirectory, errorText, errorMessage);
|
||||
}
|
||||
return rc;
|
||||
return executeAndHandleConflicts(workingDirectory, arguments);
|
||||
}
|
||||
|
||||
bool GitClient::synchronousStashRemove(const QString &workingDirectory,
|
||||
|
||||
@@ -201,8 +201,7 @@ public:
|
||||
bool synchronousStashRestore(const QString &workingDirectory,
|
||||
const QString &stash,
|
||||
bool pop = false,
|
||||
const QString &branch = QString(),
|
||||
QString *errorMessage = 0);
|
||||
const QString &branch = QString());
|
||||
bool synchronousStashRemove(const QString &workingDirectory,
|
||||
const QString &stash = QString(),
|
||||
QString *errorMessage = 0);
|
||||
|
||||
@@ -64,7 +64,9 @@ public:
|
||||
if (isCheckable(i) && source->isCheckable(j))
|
||||
setChecked(i, source->checked(j));
|
||||
break;
|
||||
} else if (stateFile < sourceStateFile) {
|
||||
} else if (((stateFile.first & UntrackedFile)
|
||||
== (sourceStateFile.first & UntrackedFile))
|
||||
&& (stateFile < sourceStateFile)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,12 +323,10 @@ void StashDialog::restoreCurrent()
|
||||
QString name = m_model->at(index).name;
|
||||
// Make sure repository is not modified, restore. The command will
|
||||
// output to window on success.
|
||||
const bool success = promptForRestore(&name, 0, &errorMessage)
|
||||
&& gitClient()->synchronousStashRestore(m_repository, name, false, QString(), &errorMessage);
|
||||
if (success) {
|
||||
if (promptForRestore(&name, 0, &errorMessage)
|
||||
&& gitClient()->synchronousStashRestore(m_repository, name)) {
|
||||
refresh(m_repository, true); // Might have stashed away local changes.
|
||||
} else {
|
||||
if (!errorMessage.isEmpty())
|
||||
} else if (!errorMessage.isEmpty()) {
|
||||
warning(msgRestoreFailedTitle(name), errorMessage);
|
||||
}
|
||||
}
|
||||
@@ -340,13 +338,11 @@ void StashDialog::restoreCurrentInBranch()
|
||||
QString errorMessage;
|
||||
QString branch;
|
||||
QString name = m_model->at(index).name;
|
||||
const bool success = promptForRestore(&name, &branch, &errorMessage)
|
||||
&& gitClient()->synchronousStashRestore(m_repository, name, false, branch, &errorMessage);
|
||||
if (success) {
|
||||
if (promptForRestore(&name, &branch, &errorMessage)
|
||||
&& gitClient()->synchronousStashRestore(m_repository, name, false, branch)) {
|
||||
refresh(m_repository, true); // git deletes the stash, unfortunately.
|
||||
} else {
|
||||
if (!errorMessage.isEmpty())
|
||||
warning(msgRestoreFailedTitle(name), errorMessage);
|
||||
} else if (!errorMessage.isEmpty()) {
|
||||
warning(msgRestoreFailedTitle(name), errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user