Hello community, here is the log from the commit of package libkomparediff2 for openSUSE:Factory checked in at 2014-10-16 18:12:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libkomparediff2 (Old) and /work/SRC/openSUSE:Factory/.libkomparediff2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libkomparediff2" Changes: -------- --- /work/SRC/openSUSE:Factory/libkomparediff2/libkomparediff2.changes 2014-09-18 07:58:38.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libkomparediff2.new/libkomparediff2.changes 2014-10-16 18:12:32.000000000 +0200 @@ -1,0 +2,7 @@ +Sun Oct 12 12:03:17 UTC 2014 - tittiatc...@gmail.com + +- Update to 4.14.2 + * KDE 4.14.2 SC Bugfix Release + * See http://www.kde.org/announcements/announce-4.14.2.php + +------------------------------------------------------------------- Old: ---- libkomparediff2-4.14.1.tar.xz New: ---- libkomparediff2-4.14.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libkomparediff2.spec ++++++ --- /var/tmp/diff_new_pack.MFbxml/_old 2014-10-16 18:12:33.000000000 +0200 +++ /var/tmp/diff_new_pack.MFbxml/_new 2014-10-16 18:12:33.000000000 +0200 @@ -24,7 +24,7 @@ Summary: A library to compare files and strings License: (GPL-2.0+ and LGPL-2.0+) and BSD-2-Clause Group: Development/Libraries/KDE -Version: 4.14.1 +Version: 4.14.2 Release: 0 Url: http://www.kde.org Source0: %{name}-%{version}.tar.xz ++++++ libkomparediff2-4.14.1.tar.xz -> libkomparediff2-4.14.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkomparediff2-4.14.1/diffparser.cpp new/libkomparediff2-4.14.2/diffparser.cpp --- old/libkomparediff2-4.14.1/diffparser.cpp 2013-11-16 20:25:59.000000000 +0100 +++ new/libkomparediff2-4.14.2/diffparser.cpp 2014-09-28 19:09:27.000000000 +0200 @@ -24,8 +24,8 @@ DiffParser::DiffParser( const KompareModelList* list, const QStringList& diff ) : ParserBase( list, diff ) { // The regexps needed for context diff parsing, the rest is the same as in parserbase.cpp - m_contextDiffHeader1.setPattern( "\\*\\*\\* ([^\\t]+)\\t([^\\t]+)\\n" ); - m_contextDiffHeader2.setPattern( "--- ([^\\t]+)\\t([^\\t]+)\\n" ); + m_contextDiffHeader1.setPattern( "\\*\\*\\* ([^\\t]+)(\\t([^\\t]+))?\\n" ); + m_contextDiffHeader2.setPattern( "--- ([^\\t]+)(\\t([^\\t]+))?\\n" ); } DiffParser::~DiffParser() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkomparediff2-4.14.1/parserbase.cpp new/libkomparediff2-4.14.2/parserbase.cpp --- old/libkomparediff2-4.14.1/parserbase.cpp 2013-11-16 20:25:59.000000000 +0100 +++ new/libkomparediff2-4.14.2/parserbase.cpp 2014-09-28 19:09:27.000000000 +0200 @@ -42,7 +42,7 @@ // used in contexthunkheader m_contextHunkHeader1.setPattern( "\\*{15} ?(.*)\\n" ); // capture is for function name - m_contextHunkHeader2.setPattern( "\\*\\*\\* ([0-9]+),([0-9]+) \\*\\*\\*\\*\\n" ); + m_contextHunkHeader2.setPattern( "\\*\\*\\* ([0-9]+),([0-9]+) \\*\\*\\*\\*.*\\n" ); // used in contexthunkbody m_contextHunkHeader3.setPattern( "--- ([0-9]+),([0-9]+) ----\\n" ); @@ -136,10 +136,10 @@ // kDebug(8101) << "Matched string Header2 = " << m_contextDiffHeader2.cap( 0 ) << endl; m_currentModel = new DiffModel( m_contextDiffHeader1.cap( 1 ), m_contextDiffHeader2.cap( 1 ) ); - m_currentModel->setSourceTimestamp ( m_contextDiffHeader1.cap( 2 ) ); - m_currentModel->setSourceRevision ( m_contextDiffHeader1.cap( 4 ) ); - m_currentModel->setDestinationTimestamp( m_contextDiffHeader2.cap( 2 ) ); - m_currentModel->setDestinationRevision ( m_contextDiffHeader2.cap( 4 ) ); + m_currentModel->setSourceTimestamp ( m_contextDiffHeader1.cap( 3 ) ); + m_currentModel->setSourceRevision ( m_contextDiffHeader1.cap( 5 ) ); + m_currentModel->setDestinationTimestamp( m_contextDiffHeader2.cap( 3 ) ); + m_currentModel->setDestinationRevision ( m_contextDiffHeader2.cap( 5 ) ); ++m_diffIterator; result = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkomparediff2-4.14.1/tests/interactivedifftest.cpp new/libkomparediff2-4.14.2/tests/interactivedifftest.cpp --- old/libkomparediff2-4.14.1/tests/interactivedifftest.cpp 2013-11-16 20:25:59.000000000 +0100 +++ new/libkomparediff2-4.14.2/tests/interactivedifftest.cpp 2014-09-28 19:09:27.000000000 +0200 @@ -724,4 +724,96 @@ QCOMPARE(model->differenceAt(3)->trackingDestinationLineNumber(), 32); } +static void +contextDiff1() +{ + QStringList patch; + patch << + "commit 7377fcc682e85ef9784adb2a2da2c8c6756f9018 (HEAD, KDE/4.11)\n" << + "Author: Dr. ChocholouĊĦek <b...@zin.ec>\n" << + "AuthorDate: Sat Jan 25 17:30:01 2014 +0100\n" << + "\n" << + " Fake diff.\n" << + "\n" << + "diff --git a/libdiff2/diffmodel.cpp b/libdiff2/diffmodel.cpp\n" << + "new file mode 100644\n" << + "index a42e82d..a8da0c9\n" << + "*** a/libdiff2/diffmodel.cpp\n" << // note the missing timestamps + "--- b/libdiff2/diffmodel.cpp\n" << + "*************** DiffModel::DiffModel() :\n" << + "*** 58,64 ****\n" << + " m_sourceFile( "" ),\n" << + " m_destinationFile( "" ),\n" << + " m_sourceTimestamp( "" ),\n" << + "! m_destinationTimestamp( "" ),\n" << + " m_sourceRevision( "" ),\n" << + " m_destinationRevision( "" ),\n" << + " m_appliedCount( 0 ),\n" << + "--- 58,64 ----\n" << + " m_sourceFile( "" ),\n" << + " m_destinationFile( "" ),\n" << + " m_sourceTimestamp( "" ),\n" << + "! m_destinationTimestamp( \"doh\" ),\n" << + " m_sourceRevision( "" ),\n" << + " m_destinationRevision( "" ),\n" << + " m_appliedCount( 0 ),\n" << + "*************** void DiffModel::splitSourceInPathAndFile\n" << + "*** 84,89 ****\n" << + "--- 84,91 ----\n" << + " if( ( pos = m_source.lastIndexOf( \"/\" ) ) >= 0 )\n" << + " m_sourcePath = m_source.mid( 0, pos+1 );\n" << + " \n" << + "+ add_this;\n" << + "+ \n" << + " if( ( pos = m_source.lastIndexOf( \"/\" ) ) >= 0 )\n" << + " m_sourceFile = m_source.mid( pos+1, m_source.length() - pos );\n" << + " else\n"; + Parser parser(0); + DiffModelList* models = parser.parse(patch); + QCOMPARE(models->size(), 1); + DiffModel* model = models->at(0); + QCOMPARE(model->differenceCount(), 2); + model->applyAllDifferences(true); + QVERIFY(model->differenceAt(0)->applied()); + QCOMPARE(model->differenceAt(0)->sourceLineNumber(), 61); + QCOMPARE(model->differenceAt(0)->trackingDestinationLineNumber(), 61); + QCOMPARE(model->differenceAt(1)->sourceLineNumber(), 87); + QCOMPARE(model->differenceAt(1)->trackingDestinationLineNumber(), 87); +} + +static void +contextDiff2() +{ + QStringList patch; + patch << + "*** a/libdiff2/diffmodel.cpp\n" << + "--- b/libdiff2/diffmodel.cpp\n" << + "***************\n" << + "*** 55,60 **** DiffModel::DiffModel() :\n" << // note the context here + "--- 55,61 ----\n" << + " m_destination( "" ),\n" << + " m_sourcePath( "" ),\n" << + " m_destinationPath( "" ),\n" << + "+ m_hoh ( "" );\n" << + " m_sourceFile( "" ),\n" << + " m_destinationFile( "" ),\n" << + " m_sourceTimestamp( "" ),\n"; + + Parser parser(0); + DiffModelList* models = parser.parse(patch); + QCOMPARE(models->size(), 1); + DiffModel* model = models->at(0); + QCOMPARE(model->differenceCount(), 1); + model->applyAllDifferences(true); + QVERIFY(model->differenceAt(0)->applied()); + QCOMPARE(model->differenceAt(0)->sourceLineNumber(), 58); + QCOMPARE(model->differenceAt(0)->trackingDestinationLineNumber(), 58); +} + +void InteractiveDiffTest::testContextDiff() +{ + contextDiff1(); + contextDiff2(); +} + QTEST_MAIN(InteractiveDiffTest); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkomparediff2-4.14.1/tests/interactivedifftest.h new/libkomparediff2-4.14.2/tests/interactivedifftest.h --- old/libkomparediff2-4.14.1/tests/interactivedifftest.h 2013-11-16 20:25:59.000000000 +0100 +++ new/libkomparediff2-4.14.2/tests/interactivedifftest.h 2014-09-28 19:09:27.000000000 +0200 @@ -40,6 +40,7 @@ void testExistingAndApplied(); void testOneLineDeletionUnapplied(); void testApplyUnapply(); + void testContextDiff(); private: void CompareDifferenceStringList(const Diff2::DifferenceStringList& actual, const QStringList& expected); }; -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org