forked from qt-creator/qt-creator
Git: Add subject to log combobox
Change-Id: Icb76ad1c0783615172d929e8cf402feaffaddbdd Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
f6f822f5f6
commit
8f4817152c
@@ -271,5 +271,17 @@ void GitEditor::addChangeActions(QMenu *menu, const QString &change)
|
||||
menu->addAction(tr("Revert Change %1").arg(change), this, SLOT(revertChange()));
|
||||
}
|
||||
|
||||
QString GitEditor::revisionSubject(const QTextBlock &inBlock) const
|
||||
{
|
||||
for (QTextBlock block = inBlock.next(); block.isValid(); block = block.next()) {
|
||||
const QString line = block.text().trimmed();
|
||||
if (line.isEmpty()) {
|
||||
block = block.next();
|
||||
return block.text().trimmed();
|
||||
}
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Git
|
||||
|
||||
@@ -66,6 +66,7 @@ private:
|
||||
QStringList annotationPreviousVersions(const QString &revision) const;
|
||||
bool isValidRevision(const QString &revision) const;
|
||||
void addChangeActions(QMenu *menu, const QString &change);
|
||||
QString revisionSubject(const QTextBlock &inBlock) const;
|
||||
|
||||
mutable QRegExp m_changeNumberPattern8;
|
||||
mutable QRegExp m_changeNumberPattern40;
|
||||
|
||||
@@ -1318,7 +1318,7 @@ void GitPlugin::testDiffFileResolving()
|
||||
void GitPlugin::testLogResolving()
|
||||
{
|
||||
QByteArray data(
|
||||
"commit 50a6b54c03219ad74b9f3f839e0321be18daeaf6\n"
|
||||
"commit 50a6b54c03219ad74b9f3f839e0321be18daeaf6 (HEAD, origin/master)\n"
|
||||
"Merge: 3587b51 bc93ceb\n"
|
||||
"Author: Junio C Hamano <gitster@pobox.com>\n"
|
||||
"Date: Fri Jan 25 12:53:31 2013 -0800\n"
|
||||
@@ -1338,7 +1338,9 @@ void GitPlugin::testLogResolving()
|
||||
" Signed-off-by: Junio C Hamano <gitster@pobox.com>\n"
|
||||
);
|
||||
GitEditor editor(editorParameters + 1, 0);
|
||||
editor.testLogResolving(data, "50a6b54c", "3587b513");
|
||||
editor.testLogResolving(data,
|
||||
"50a6b54c - Merge branch 'for-junio' of git://bogomips.org/git-svn",
|
||||
"3587b513 - Update draft release notes to 1.8.2");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user