]> andersk Git - svn-all-fast-export.git/blobdiff - src/svn.cpp
Ignore paths being deleted when we don't know anything about them
[svn-all-fast-export.git] / src / svn.cpp
index 7ec39087e502fa4437b80ce4f843dd2ee5ed3d1b..d6bf136cfac4e95fe0556a1e6835c27d3c5f76d3 100644 (file)
@@ -325,7 +325,8 @@ int SvnPrivate::exportRevision(int revnum)
     QHash<QString, Repository::Transaction *> transactions;
 
     // open this revision:
-    qDebug() << "Exporting revision" << revnum;
+    printf("Exporting revision %d ", revnum);
+    fflush(stdout);
     svn_fs_root_t *fs_root;
     SVN_ERR(svn_fs_revision_root(&fs_root, fs, revnum, pool));
 
@@ -340,6 +341,8 @@ int SvnPrivate::exportRevision(int revnum)
         void *value;
         apr_hash_this(i, &vkey, NULL, &value);
         const char *key = reinterpret_cast<const char *>(vkey);
+        QString current = QString::fromUtf8(key);
+        svn_fs_path_change_t *change = reinterpret_cast<svn_fs_path_change_t *>(value);
 
         // was this copied from somewhere?
         svn_revnum_t rev_from;
@@ -353,17 +356,14 @@ int SvnPrivate::exportRevision(int revnum)
             if (path_from == NULL) {
                 // no, it's a new directory being added
                 // Git doesn't handle directories, so we don't either
-                qDebug() << "   mkdir ignored:" << key;
+                //qDebug() << "   mkdir ignored:" << key;
                 continue;
             }
 
+            current += '/';
             qDebug() << "   " << key << "was copied from" << path_from;
         }
 
-        QString current = QString::fromUtf8(key);
-        if (is_dir)
-            current += '/';
-
         // find the first rule that matches this pathname
         MatchRuleList::ConstIterator match = findMatchRule(matchRules, revnum, current);
         if (match != matchRules.constEnd()) {
@@ -443,7 +443,6 @@ int SvnPrivate::exportRevision(int revnum)
                     transactions.insert(repository, txn);
                 }
 
-                svn_fs_path_change_t *change = reinterpret_cast<svn_fs_path_change_t *>(value);
                 if (change->change_kind == svn_fs_path_change_delete)
                     txn->deleteFile(path);
                 else if (!is_dir)
@@ -459,6 +458,8 @@ int SvnPrivate::exportRevision(int revnum)
             qDebug() << current << "is a new directory; ignoring";
         } else if (wasDir(fs, revnum - 1, key, pool)) {
             qDebug() << current << "was a directory; ignoring";
+        } else if (change->change_kind == svn_fs_path_change_delete) {
+            qDebug() << current << "is being deleted but I don't know anything about it; ignoring";
         } else {
             qCritical() << current << "did not match any rules; cannot continue";
             return EXIT_FAILURE;
@@ -466,8 +467,10 @@ int SvnPrivate::exportRevision(int revnum)
     }
     revpool.clear();
 
-    if (transactions.isEmpty())
+    if (transactions.isEmpty()) {
+        printf("nothing to do\n");
         return EXIT_SUCCESS;    // no changes?
+    }
 
     // now create the commit
     apr_hash_t *revprops;
@@ -496,6 +499,6 @@ int SvnPrivate::exportRevision(int revnum)
         delete txn;
     }
 
-    printf("\n");
+    printf("done\n");
     return EXIT_SUCCESS;
 }
This page took 0.028765 seconds and 4 git commands to generate.