aboutsummaryrefslogtreecommitdiffstats
path: root/src/svn.cpp
diff options
context:
space:
mode:
authorUlrich Spörlein <uqs@spoerlein.net>2010-04-19 23:06:00 +0200
committerTorgny Nyblom <kde@nyblom.org>2010-04-29 20:48:49 +0200
commit64a45f529c6e3e08b2ddbb1b23870d89a3a62cd3 (patch)
tree9d2be97723685cf578b1f411b277cbaa7797e42f /src/svn.cpp
parent95ac50d6ecafa8a318c8aa278ab2ef1d04277dd1 (diff)
downloadsvn2git-64a45f529c6e3e08b2ddbb1b23870d89a3a62cd3.tar
svn2git-64a45f529c6e3e08b2ddbb1b23870d89a3a62cd3.tar.gz
svn2git-64a45f529c6e3e08b2ddbb1b23870d89a3a62cd3.tar.bz2
svn2git-64a45f529c6e3e08b2ddbb1b23870d89a3a62cd3.tar.xz
svn2git-64a45f529c6e3e08b2ddbb1b23870d89a3a62cd3.zip
Implement the replace node changeset which exists from some repositories namely the FreeBSD svn rep
Diffstat (limited to 'src/svn.cpp')
-rw-r--r--src/svn.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/svn.cpp b/src/svn.cpp
index 7babe31..0e7a1b7 100644
--- a/src/svn.cpp
+++ b/src/svn.cpp
@@ -509,15 +509,31 @@ int SvnRevision::exportEntry(const char *key, const svn_fs_path_change_t *change
svn_boolean_t is_dir;
SVN_ERR(svn_fs_is_dir(&is_dir, fs_root, key, revpool));
if (is_dir) {
- if (path_from == NULL) {
- // no, it's a new directory being added
+ if (change->change_kind == svn_fs_path_change_modify ||
+ change->change_kind == svn_fs_path_change_add) {
+ if (path_from == NULL) {
+ // freshly added directory, or modified properties
// Git doesn't handle directories, so we don't either
//qDebug() << " mkdir ignored:" << key;
return EXIT_SUCCESS;
- }
+ }
- current += '/';
- qDebug() << " " << key << "was copied from" << path_from << "rev" << rev_from;
+ current += '/';
+ qDebug() << " " << key << "was copied from" << path_from << "rev" << rev_from;
+ } else if (change->change_kind == svn_fs_path_change_delete) {
+ qDebug() << " " << key << "was deleted";
+ } else if (change->change_kind == svn_fs_path_change_replace) {
+ if (path_from == NULL)
+ qDebug() << " " << key << "was replaced";
+ else
+ qDebug() << " " << key << "was replaced from" << path_from << "rev" << rev_from;
+ } else if (change->change_kind == svn_fs_path_change_reset) {
+ qCritical() << " " << key << "was reset, panic!";
+ return EXIT_FAILURE;
+ } else {
+ qCritical() << " " << key << "has unhandled change kind " << change->change_kind << ", panic!";
+ return EXIT_FAILURE;
+ }
}
// find the first rule that matches this pathname
@@ -647,6 +663,8 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change_t *cha
transactions.insert(repository + branch, txn);
}
+ if (change->change_kind == svn_fs_path_change_replace && path_from == NULL)
+ txn->deleteFile(path);
if (change->change_kind == svn_fs_path_change_delete) {
txn->deleteFile(path);
} else if (!current.endsWith('/')) {