VCS: Use entries combobox for log

Tests included

Change-Id: Ibe2f6ece207128f8467b0cbca9dc38f2bcd5ced6
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-01-28 22:02:35 +02:00
committed by Orgad Shaneh
parent d0f1193041
commit 7cb80f0e16
23 changed files with 208 additions and 0 deletions

View File

@@ -73,6 +73,7 @@ GitEditor::GitEditor(const VcsBase::VcsBaseEditorParameters *type,
+++ b/src/plugins/git/giteditor.cpp
*/
setDiffFilePattern(QRegExp(QLatin1String("^(?:diff --git a/|index |[+-]{3} (?:/dev/null|[ab]/(.+$)))")));
setLogEntryPattern(QRegExp(QLatin1String("^commit ([0-9a-f]{8})[0-9a-f]{32}")));
setAnnotateRevisionTextFormat(tr("Blame %1"));
setAnnotatePreviousRevisionTextFormat(tr("Blame Parent Revision %1"));
}

View File

@@ -1314,6 +1314,32 @@ void GitPlugin::testDiffFileResolving()
GitEditor editor(editorParameters + 3, 0);
editor.testDiffFileResolving();
}
void GitPlugin::testLogResolving()
{
QByteArray data(
"commit 50a6b54c03219ad74b9f3f839e0321be18daeaf6\n"
"Merge: 3587b51 bc93ceb\n"
"Author: Junio C Hamano <gitster@pobox.com>\n"
"Date: Fri Jan 25 12:53:31 2013 -0800\n"
"\n"
" Merge branch 'for-junio' of git://bogomips.org/git-svn\n"
" \n"
" * 'for-junio' of git://bogomips.org/git-svn:\n"
" git-svn: Simplify calculation of GIT_DIR\n"
" git-svn: cleanup sprintf usage for uppercasing hex\n"
"\n"
"commit 3587b513bafd7a83d8c816ac1deed72b5e3a27e9\n"
"Author: Junio C Hamano <gitster@pobox.com>\n"
"Date: Fri Jan 25 12:52:55 2013 -0800\n"
"\n"
" Update draft release notes to 1.8.2\n"
" \n"
" Signed-off-by: Junio C Hamano <gitster@pobox.com>\n"
);
GitEditor editor(editorParameters + 1, 0);
editor.testLogResolving(data, "50a6b54c", "3587b513");
}
#endif
Q_EXPORT_PLUGIN(GitPlugin)

View File

@@ -145,6 +145,7 @@ private slots:
void testStatusParsing();
void testDiffFileResolving_data();
void testDiffFileResolving();
void testLogResolving();
#endif
protected:
void updateActions(VcsBase::VcsBasePlugin::ActionState);