From kde-commits Thu Feb 05 17:34:25 2009 From: Mickael Marchand Date: Thu, 05 Feb 2009 17:34:25 +0000 To: kde-commits Subject: KDE/kdesdk/kioslave/svn/ksvnd Message-Id: <1233855265.814000.11867.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=123385528628020 SVN commit 921794 by marchand: Fix svn 1.4 compatibility Applied patch (well, one year late but still) thanks for it ;) BUG: 153842 M +24 -1 ksvnd.cpp --- trunk/KDE/kdesdk/kioslave/svn/ksvnd/ksvnd.cpp #921793:921794 @@ -117,12 +117,29 @@ bool KSvnd::isFileInSvnEntries ( const QString &filename, const QString &entfile ) { QFile file( entfile ); + bool potential = false; if ( file.open( QIODevice::ReadOnly ) ) { QTextStream stream( &file ); QString line; while ( !stream.atEnd() ) { line = stream.readLine().simplified(); - if ( line == "name=\""+ filename + "\"" ) { + + if ( potential == true ) { + // Check that filename is really a file or dir + if ( line == "dir" || line == "file" ) { + file.close(); + return true; + } else { + // Reset potential to false + potential=false; + } + } + + if ( line == filename ) { + // Assume we're using SVN >= 1.4 + potential=true; + } else if ( line == "name=\""+ filename + "\"" ) { + // We could still be using SVN <= 1.3 (XML format) file.close(); return true; } @@ -270,6 +287,12 @@ if ( !(listStatus & SomeAreInParentsEntries) && !(listStatus & SomeAreExternalToParent) && !(listStatus & SomeHaveSvn)) { + if ( (listStatus & AllParentsHaveSvn) ) { + // These files can only be added to SVN + result << "Add"; + result << "_SEPARATOR_"; + } + if( list.size() == 1 && listStatus & SomeAreFolders) { result << "Checkout"; result << "Export";