forked from qt-creator/qt-creator
Git: Limit size of conflicted files list
Change-Id: I98996eee080ca25b812b53d02a89f45fdcdf3c52 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
2ad1efd876
commit
b643f33ee4
@@ -2838,12 +2838,20 @@ void GitClient::handleMergeConflicts(const QString &workingDir, const QString &c
|
|||||||
const QStringList &files, const QString &abortCommand)
|
const QStringList &files, const QString &abortCommand)
|
||||||
{
|
{
|
||||||
QString message;
|
QString message;
|
||||||
if (!commit.isEmpty())
|
if (!commit.isEmpty()) {
|
||||||
message = tr("Conflicts detected with commit %1.").arg(commit);
|
message = tr("Conflicts detected with commit %1.").arg(commit);
|
||||||
else if (!files.isEmpty())
|
} else if (!files.isEmpty()) {
|
||||||
message = tr("Conflicts detected with files:\n%1").arg(files.join(QLatin1Char('\n')));
|
QString fileList;
|
||||||
else
|
QStringList partialFiles = files;
|
||||||
|
while (partialFiles.count() > 20)
|
||||||
|
partialFiles.removeLast();
|
||||||
|
fileList = partialFiles.join(QLatin1Char('\n'));
|
||||||
|
if (partialFiles.count() != files.count())
|
||||||
|
fileList += QLatin1String("\n...");
|
||||||
|
message = tr("Conflicts detected with files:\n%1").arg(fileList);
|
||||||
|
} else {
|
||||||
message = tr("Conflicts detected.");
|
message = tr("Conflicts detected.");
|
||||||
|
}
|
||||||
QMessageBox mergeOrAbort(QMessageBox::Question, tr("Conflicts Detected"), message,
|
QMessageBox mergeOrAbort(QMessageBox::Question, tr("Conflicts Detected"), message,
|
||||||
QMessageBox::NoButton, ICore::mainWindow());
|
QMessageBox::NoButton, ICore::mainWindow());
|
||||||
QPushButton *mergeToolButton = mergeOrAbort.addButton(tr("Run &Merge Tool"),
|
QPushButton *mergeToolButton = mergeOrAbort.addButton(tr("Run &Merge Tool"),
|
||||||
|
|||||||
Reference in New Issue
Block a user