From 01a0bb21489c7d6f019df3b8efc5cbdec7c4b443 Mon Sep 17 00:00:00 2001 From: Niko Sams Date: Mon, 4 Oct 2010 20:44:13 +0200 Subject: support svn commit that converts a link into a file in one commit this happens in kde svn rev 841619 --- src/svn.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/svn.cpp') diff --git a/src/svn.cpp b/src/svn.cpp index dd3ce53..7511326 100644 --- a/src/svn.cpp +++ b/src/svn.cpp @@ -285,11 +285,17 @@ static int dumpBlob(Repository::Transaction *txn, svn_fs_root_t *fs_root, QByteArray buf; buf.reserve(len); SVN_ERR(svn_stream_read(in_stream, buf.data(), &len)); - if (len != strlen("link ") || strncmp(buf, "link ", len) != 0) - qFatal("file %s is svn:special but not a symlink", pathname); + if (len == strlen("link ") && strncmp(buf, "link ", len) == 0) { + mode = 0120000; + stream_length -= len; + } else { + //this can happen if a link changed into a file in one commit + qWarning("file %s is svn:special but not a symlink", pathname); + // re-open the file as we tried to read "link " + svn_stream_close(in_stream); + SVN_ERR(svn_fs_file_contents(&in_stream, fs_root, pathname, dumppool)); + } } - mode = 0120000; - stream_length -= len; } QIODevice *io = txn->addFile(finalPathName, mode, stream_length); -- cgit v1.2.1