forked from qt-creator/qt-creator
Git: Prompt for unchanged file after custom mergetool fails
To reproduce, create a conflict and configure a custom mergetool that does nothing: git config mergetool.my.cmd true git config merge.tool my Then execute merge tool from Qt Creator. The merge tool process hangs while asking how to handle the unchanged file, and can only be killed externally. Change-Id: I4d2a91061bd7549e308f6a25f106e6a7afc5cadb Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
53c4b36e4a
commit
573958e79f
@@ -218,6 +218,18 @@ void MergeTool::addButton(QMessageBox *msgBox, const QString &text, char key)
|
|||||||
msgBox->addButton(text, QMessageBox::AcceptRole)->setProperty("key", key);
|
msgBox->addButton(text, QMessageBox::AcceptRole)->setProperty("key", key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MergeTool::prompt(const QString &title, const QString &question)
|
||||||
|
{
|
||||||
|
if (QMessageBox::question(Core::ICore::dialogParent(), title, question,
|
||||||
|
QMessageBox::Yes | QMessageBox::No,
|
||||||
|
QMessageBox::No) == QMessageBox::Yes) {
|
||||||
|
m_process->write("y\n");
|
||||||
|
} else {
|
||||||
|
m_process->write("n\n");
|
||||||
|
}
|
||||||
|
m_process->waitForBytesWritten();
|
||||||
|
}
|
||||||
|
|
||||||
void MergeTool::readData()
|
void MergeTool::readData()
|
||||||
{
|
{
|
||||||
while (m_process->bytesAvailable()) {
|
while (m_process->bytesAvailable()) {
|
||||||
@@ -231,16 +243,10 @@ void MergeTool::readData()
|
|||||||
m_localState = waitAndReadStatus(m_localInfo);
|
m_localState = waitAndReadStatus(m_localInfo);
|
||||||
m_remoteState = waitAndReadStatus(m_remoteInfo);
|
m_remoteState = waitAndReadStatus(m_remoteInfo);
|
||||||
chooseAction();
|
chooseAction();
|
||||||
|
} else if (line.startsWith("Was the merge successful")) {
|
||||||
|
prompt(tr("Unchanged File"), tr("Was the merge successful?"));
|
||||||
} else if (line.startsWith("Continue merging")) {
|
} else if (line.startsWith("Continue merging")) {
|
||||||
if (QMessageBox::question(Core::ICore::dialogParent(), tr("Continue Merging"),
|
prompt(tr("Continue Merging"), tr("Continue merging other unresolved paths?"));
|
||||||
tr("Continue merging other unresolved paths?"),
|
|
||||||
QMessageBox::Yes | QMessageBox::No,
|
|
||||||
QMessageBox::No) == QMessageBox::Yes) {
|
|
||||||
m_process->write("y\n");
|
|
||||||
} else {
|
|
||||||
m_process->write("n\n");
|
|
||||||
}
|
|
||||||
m_process->waitForBytesWritten();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -64,6 +64,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void prompt(const QString &title, const QString &question);
|
||||||
void readData();
|
void readData();
|
||||||
void done();
|
void done();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user