diff options
author | Niko Sams <niko.sams@gmail.com> | 2010-10-04 20:44:13 +0200 |
---|---|---|
committer | Niko Sams <niko.sams@gmail.com> | 2010-10-04 20:44:13 +0200 |
commit | 01a0bb21489c7d6f019df3b8efc5cbdec7c4b443 (patch) | |
tree | dcfa3630c8e0b900dbf4f41d3c9177d4819c421b /src | |
parent | f11207edc33ccaf91b28fb86b135fa42cd5cf46b (diff) | |
download | svn2git-01a0bb21489c7d6f019df3b8efc5cbdec7c4b443.tar svn2git-01a0bb21489c7d6f019df3b8efc5cbdec7c4b443.tar.gz svn2git-01a0bb21489c7d6f019df3b8efc5cbdec7c4b443.tar.bz2 svn2git-01a0bb21489c7d6f019df3b8efc5cbdec7c4b443.tar.xz svn2git-01a0bb21489c7d6f019df3b8efc5cbdec7c4b443.zip |
support svn commit that converts a link into a file in one commit
this happens in kde svn rev 841619
Diffstat (limited to 'src')
-rw-r--r-- | src/svn.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
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); |