Commit 7cb80f0e authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

VCS: Use entries combobox for log



Tests included

Change-Id: Ibe2f6ece207128f8467b0cbca9dc38f2bcd5ced6
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent d0f11930
......@@ -59,6 +59,7 @@ BazaarEditor::BazaarEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget
// Diff format:
// === <change> <file|dir> 'mainwindow.cpp'
setDiffFilePattern(QRegExp(QLatin1String("^=== [a-z]+ [a-z]+ '(.+)'\\s*")));
setLogEntryPattern(QRegExp(QLatin1String("^revno: (\\d+)")));
}
QSet<QString> BazaarEditor::annotationChanges() const
......
......@@ -624,6 +624,30 @@ void BazaarPlugin::testDiffFileResolving()
BazaarEditor editor(editorParameters + 3, 0);
editor.testDiffFileResolving();
}
void BazaarPlugin::testLogResolving()
{
QByteArray data(
"------------------------------------------------------------\n"
"revno: 6572 [merge]\n"
"committer: Patch Queue Manager <pqm@pqm.ubuntu.com>\n"
"branch nick: +trunk\n"
"timestamp: Mon 2012-12-10 10:18:33 +0000\n"
"message:\n"
" (vila) Fix LC_ALL=C test failures related to utf8 stderr encoding (Vincent\n"
" Ladeuil)\n"
"------------------------------------------------------------\n"
"revno: 6571 [merge]\n"
"committer: Patch Queue Manager <pqm@pqm.ubuntu.com>\n"
"branch nick: +trunk\n"
"timestamp: Thu 2012-10-25 11:13:27 +0000\n"
"message:\n"
" (gz) Set approved revision and vote \"Approve\" when using lp-propose\n"
" --approve (Jonathan Lange)\n"
);
BazaarEditor editor(editorParameters + 1, 0);
editor.testLogResolving(data, "6572", "6571");
}
#endif
void BazaarPlugin::commitFromEditor()
......
......@@ -115,6 +115,7 @@ private slots:
#ifdef WITH_TESTS
void testDiffFileResolving_data();
void testDiffFileResolving();
void testLogResolving();
#endif
protected:
......
......@@ -57,6 +57,7 @@ ClearCaseEditor::ClearCaseEditor(const VcsBase::VcsBaseEditorParameters *type,
QRegExp diffFilePattern(QLatin1String("^[-+]{3} ([^\\t]+)(?:@@|\\t)"));
diffFilePattern.setMinimal(true);
setDiffFilePattern(diffFilePattern);
setLogEntryPattern(QRegExp(QLatin1String("version \"([^\"]+)\"")));
setAnnotateRevisionTextFormat(tr("Annotate version \"%1\""));
}
......
......@@ -1963,6 +1963,18 @@ void ClearCasePlugin::testDiffFileResolving()
ClearCaseEditor editor(editorParameters + 3, 0);
editor.testDiffFileResolving();
}
void ClearCasePlugin::testLogResolving()
{
QByteArray data(
"13-Sep.17:41 user1 create version \"src/plugins/clearcase/clearcaseeditor.h@@/main/branch1/branch2/9\" (baseline1, baseline2, ...)\n"
"22-Aug.14:13 user2 create version \"src/plugins/clearcase/clearcaseeditor.h@@/main/branch1/branch2/8\" (baseline3, baseline4, ...)\n"
);
ClearCaseEditor editor(editorParameters + 1, 0);
editor.testLogResolving(data,
"src/plugins/clearcase/clearcaseeditor.h@@/main/branch1/branch2/9",
"src/plugins/clearcase/clearcaseeditor.h@@/main/branch1/branch2/8");
}
#endif
} // namespace Internal
......
......@@ -195,6 +195,7 @@ private slots:
#ifdef WITH_TESTS
void testDiffFileResolving_data();
void testDiffFileResolving();
void testLogResolving();
#endif
protected:
......
......@@ -64,6 +64,7 @@ CvsEditor::CvsEditor(const VcsBase::VcsBaseEditorParameters *type,
\endcode
*/
setDiffFilePattern(QRegExp(QLatin1String("^[-+]{3} ([^\\t]+)")));
setLogEntryPattern(QRegExp(QLatin1String("^revision (.+)$")));
setAnnotateRevisionTextFormat(tr("Annotate revision \"%1\""));
}
......
......@@ -1400,6 +1400,33 @@ void CvsPlugin::testDiffFileResolving()
CvsEditor editor(editorParameters + 3, 0);
editor.testDiffFileResolving();
}
void CvsPlugin::testLogResolving()
{
QByteArray data(
"RCS file: /sources/cvs/ccvs/Attic/FIXED-BUGS,v\n"
"Working file: FIXED-BUGS\n"
"head: 1.3\n"
"branch:\n"
"locks: strict\n"
"access list:\n"
"symbolic names:\n"
"keyword substitution: kv\n"
"total revisions: 3; selected revisions: 3\n"
"description:\n"
"----------------------------\n"
"revision 1.3\n"
"date: 1995-04-29 06:22:41 +0300; author: jimb; state: dead; lines: +0 -0;\n"
"*** empty log message ***\n"
"----------------------------\n"
"revision 1.2\n"
"date: 1995-04-28 18:52:24 +0300; author: noel; state: Exp; lines: +6 -0;\n"
"added latest commentary\n"
"----------------------------\n"
);
CvsEditor editor(editorParameters + 1, 0);
editor.testLogResolving(data, "1.3", "1.2");
}
#endif
} // namespace Internal
......
......@@ -126,6 +126,7 @@ private slots:
#ifdef WITH_TESTS
void testDiffFileResolving_data();
void testDiffFileResolving();
void testLogResolving();
#endif
protected:
......
......@@ -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"));
}
......
......@@ -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)
......@@ -145,6 +145,7 @@ private slots:
void testStatusParsing();
void testDiffFileResolving_data();
void testDiffFileResolving();
void testLogResolving();
#endif
protected:
void updateActions(VcsBase::VcsBasePlugin::ActionState);
......
......@@ -54,6 +54,7 @@ MercurialEditor::MercurialEditor(const VcsBase::VcsBaseEditorParameters *type, Q
changesetIdentifier40(QLatin1String(Constants::CHANGESETID40))
{
setDiffFilePattern(QRegExp(QLatin1String(Constants::DIFFIDENTIFIER)));
setLogEntryPattern(QRegExp(QLatin1String("^changeset:\\s+(\\S+)$")));
setAnnotateRevisionTextFormat(tr("Annotate %1"));
setAnnotatePreviousRevisionTextFormat(tr("Annotate parent revision %1"));
}
......
......@@ -720,6 +720,27 @@ void MercurialPlugin::testDiffFileResolving()
MercurialEditor editor(editorParameters + 3, 0);
editor.testDiffFileResolving();
}
void MercurialPlugin::testLogResolving()
{
QByteArray data(
"changeset: 18473:692cbda1eb50\n"
"branch: stable\n"
"bookmark: @\n"
"tag: tip\n"
"user: FUJIWARA Katsunori <foozy@lares.dti.ne.jp>\n"
"date: Wed Jan 23 22:52:55 2013 +0900\n"
"summary: revset: evaluate sub expressions correctly (issue3775)\n"
"\n"
"changeset: 18472:37100f30590f\n"
"branch: stable\n"
"user: Pierre-Yves David <pierre-yves.david@ens-lyon.org>\n"
"date: Sat Jan 19 04:08:16 2013 +0100\n"
"summary: test-rebase: add another test for rebase with multiple roots\n"
);
MercurialEditor editor(editorParameters + 1, 0);
editor.testLogResolving(data, "18473:692cbda1eb50", "18472:37100f30590f");
}
#endif
Q_EXPORT_PLUGIN(MercurialPlugin)
......@@ -106,6 +106,7 @@ private slots:
#ifdef WITH_TESTS
void testDiffFileResolving_data();
void testDiffFileResolving();
void testLogResolving();
#endif
//TODO implement
......
......@@ -67,6 +67,7 @@ PerforceEditor::PerforceEditor(const VcsBase::VcsBaseEditorParameters *type,
// 1) "==== //depot/.../mainwindow.cpp#2 - /depot/.../mainwindow.cpp ====" (created by p4 diff)
// 2) "==== //depot/.../mainwindow.cpp#15 (text) ====" (created by p4 describe)
setDiffFilePattern(QRegExp(QLatin1String("^==== (.+)#\\d")));
setLogEntryPattern(QRegExp(QLatin1String("^... #\\d change (\\d+) ")));
setAnnotateRevisionTextFormat(tr("Annotate change list \"%1\""));
if (Perforce::Constants::debug)
qDebug() << "PerforceEditor::PerforceEditor" << type->type << type->id;
......
......@@ -1526,6 +1526,23 @@ void PerforcePlugin::getTopLevel()
checker->start(m_settings.p4BinaryPath(), m_settings.commonP4Arguments(QString()), 30000);
}
#ifdef WITH_TESTS
void PerforcePlugin::testLogResolving()
{
// Source: http://mail.opensolaris.org/pipermail/opengrok-discuss/2008-October/001668.html
QByteArray data(
"... #4 change 12345 edit on 2013/01/28 by User at UserWorkspaceName(text)\n"
"\n"
" Comment\n"
"... #3 change 12344 edit on 2013/01/27 by User at UserWorkspaceName(text)\n"
"\n"
" Comment\n"
);
PerforceEditor editor(editorParameters + 1, 0);
editor.testLogResolving(data, "12345", "12344");
}
#endif
}
}
......
......@@ -137,6 +137,9 @@ private slots:
void slotTopLevelFound(const QString &);
void slotTopLevelFailed(const QString &);
#ifdef WITH_TESTS
void testLogResolving();
#endif
protected:
void updateActions(VcsBase::VcsBasePlugin::ActionState);
bool submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor);
......
......@@ -62,6 +62,7 @@ SubversionEditor::SubversionEditor(const VcsBase::VcsBaseEditorParameters *type,
\endcode
*/
setDiffFilePattern(QRegExp(QLatin1String("^[-+]{3} ([^\\t]+)|^Index: .*|^=+$")));
setLogEntryPattern(QRegExp(QLatin1String("^(r\\d+) \\|")));
setAnnotateRevisionTextFormat(tr("Annotate revision \"%1\""));
}
......
......@@ -1427,6 +1427,28 @@ void SubversionPlugin::testDiffFileResolving()
SubversionEditor editor(editorParameters + 3, 0);
editor.testDiffFileResolving();
}
void SubversionPlugin::testLogResolving()
{
QByteArray data(
"------------------------------------------------------------------------\n"
"r1439551 | philip | 2013-01-28 20:19:55 +0200 (Mon, 28 Jan 2013) | 4 lines\n"
"\n"
"* subversion/tests/cmdline/update_tests.py\n"
" (update_moved_dir_file_move): Resolve conflict, adjust expectations,\n"
" remove XFail.\n"
"\n"
"------------------------------------------------------------------------\n"
"r1439540 | philip | 2013-01-28 20:06:36 +0200 (Mon, 28 Jan 2013) | 4 lines\n"
"\n"
"* subversion/tests/cmdline/update_tests.py\n"
" (update_moved_dir_edited_leaf_del): Do non-recursive resolution, adjust\n"
" expectations, remove XFail.\n"
"\n"
);
SubversionEditor editor(editorParameters + 1, 0);
editor.testLogResolving(data, "r1439551", "r1439540");
}
#endif
} // Internal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment