]> andersk Git - svn-all-fast-export.git/blobdiff - src/svn.cpp
Wait forever. Not very efficient, but works.
[svn-all-fast-export.git] / src / svn.cpp
index 378dc771f9f958f4674ac10671a86343f4cb387e..09fddf993e45ca1aa996dc8b9eba483d670afe27 100644 (file)
@@ -160,7 +160,7 @@ int SvnPrivate::openRepository(const QString &pathToRepository)
     return EXIT_SUCCESS;
 }
 
-enum RuleType { AnyRule = 0, NoIgnoreRule = 0x01 };
+enum RuleType { AnyRule = 0, NoIgnoreRule = 0x01, NoRecurseRule = 0x02 };
 
 static MatchRuleList::ConstIterator
 findMatchRule(const MatchRuleList &matchRules, int revnum, const QString &current,
@@ -175,6 +175,8 @@ findMatchRule(const MatchRuleList &matchRules, int revnum, const QString &curren
             continue;
         if (it->action == Rules::Match::Ignore && ruleMask & NoIgnoreRule)
             continue;
+        if (it->action == Rules::Match::Recurse && ruleMask & NoRecurseRule)
+            continue;
         if (it->rx.indexIn(current) == 0)
             return it;
     }
@@ -226,8 +228,13 @@ svn_error_t *QIODevice_write(void *baton, const char *data, apr_size_t *len)
     QIODevice *device = reinterpret_cast<QIODevice *>(baton);
     device->write(data, *len);
 
-    if (device->bytesToWrite() > 16384)
-        device->waitForBytesWritten(0);
+    while (device->bytesToWrite() > 32*1024) {
+        if (!device->waitForBytesWritten(-1)) {
+            qFatal("Failed to write to process: %s", qPrintable(device->errorString()));
+            return svn_error_createf(APR_EOF, SVN_NO_ERROR, "Failed to write to process: %s",
+                                     qPrintable(device->errorString()));
+        }
+    }
     return SVN_NO_ERROR;
 }
 
@@ -510,6 +517,9 @@ int SvnRevision::exportDispatch(const char *key, const svn_fs_path_change_t *cha
     case Rules::Match::Export:
         return exportInternal(key, change, path_from, rev_from, current, rule);
     }
+
+    // never reached
+    return EXIT_FAILURE;
 }
 
 int SvnRevision::exportInternal(const char *key, const svn_fs_path_change_t *change,
This page took 0.06217 seconds and 4 git commands to generate.