Commit 8225956d authored by Hugues Delorme's avatar Hugues Delorme Committed by Tobias Hunger
Browse files

Bazaar: fix jumping into file from diff view



From a diff view, jumping into 'added' files wasn't working.
Actually file jumping was working only for 'modified' files.
This is fixed by using a more general diff regexp in class
BazaarEditor (attribute m_diffFileId)

This bugfix also allows to highlight all diff specs (rename, remove, ...)

Task-number: QTCREATORBUG-6531
Change-Id: I80bcbc0f77644c6caa7e7c750bd474a12263b589
Reviewed-by: default avatarBill King <bill.king@nokia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 803c012e
......@@ -56,7 +56,7 @@ using namespace Bazaar;
BazaarEditor::BazaarEditor(const VCSBase::VCSBaseEditorParameters *type, QWidget *parent)
: VCSBase::VCSBaseEditorWidget(type, parent),
m_exactChangesetId(QLatin1String(Constants::CHANGESET_ID_EXACT)),
m_diffFileId(QLatin1String("^=== modified file '(.*)'\\s*$"))
m_diffFileId(QLatin1String("^=== [a-z]+ [a-z]+ '(.*)'\\s*"))
{
setAnnotateRevisionTextFormat(tr("Annotate %1"));
setAnnotatePreviousRevisionTextFormat(tr("Annotate parent revision %1"));
......@@ -109,7 +109,7 @@ VCSBase::BaseAnnotationHighlighter *BazaarEditor::createAnnotationHighlighter(co
QString BazaarEditor::fileNameFromDiffSpecification(const QTextBlock &inBlock) const
{
// Check for:
// === modified file 'mainwindow.cpp'
// === <change> <file|dir> 'mainwindow.cpp'
for (QTextBlock block = inBlock; block.isValid(); block = block.previous()) {
const QString line = block.text();
if (m_diffFileId.indexIn(line) != -1)
......
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