if (propvalue)
mode = 0100755;
- // maybe it's a symlink?
- SVN_ERR(svn_fs_node_prop(&propvalue, fs_root, pathname, "svn:special", pool));
- if (propvalue && strcmp(propvalue->data, "symlink") == 0)
- mode = 0120000;
-
return mode;
}
svn_filesize_t stream_length;
SVN_ERR(svn_fs_file_length(&stream_length, fs_root, pathname, dumppool));
- QIODevice *io = txn->addFile(finalPathName, mode, stream_length);
#ifndef DRY_RUN
// open the file
svn_stream_t *in_stream, *out_stream;
SVN_ERR(svn_fs_file_contents(&in_stream, fs_root, pathname, dumppool));
+#endif
+ // maybe it's a symlink?
+ svn_string_t *propvalue;
+ SVN_ERR(svn_fs_node_prop(&propvalue, fs_root, pathname, "svn:special", dumppool));
+ if (propvalue) {
+ apr_size_t len = strlen("link ");
+#ifndef DRY_RUN
+ 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);
+#endif
+ mode = 0120000;
+ stream_length -= len;
+ }
+
+ QIODevice *io = txn->addFile(finalPathName, mode, stream_length);
+
+#ifndef DRY_RUN
// open a generic svn_stream_t for the QIODevice
out_stream = streamForDevice(io, dumppool);
SVN_ERR(svn_stream_copy(in_stream, out_stream, dumppool));
+ svn_stream_close(out_stream);
+ svn_stream_close(in_stream);
// print an ending newline
io->putChar('\n');
memset(&tm, 0, sizeof tm);
QByteArray date(svn_date, strlen(svn_date) - 8);
strptime(date, "%Y-%m-%dT%H:%M:%S", &tm);
- return mktime(&tm);
+ return timegm(&tm);
}
class SvnRevision
}
current += '/';
- qDebug() << " " << key << "was copied from" << path_from;
+ qDebug() << " " << key << "was copied from" << path_from << "rev" << rev_from;
}
// find the first rule that matches this pathname
switch (rule.action) {
case Rules::Match::Ignore:
// ignore rule
- qDebug() << " " << qPrintable(current) << "rev" << revnum
- << "-> ignored (rule" << rule << ")";
+ //qDebug() << " " << qPrintable(current) << "rev" << revnum
+ // << "-> ignored (rule" << rule << ")";
return EXIT_SUCCESS;
case Rules::Match::Recurse: