]> git.mxchange.org Git - flightgear.git/blobdiff - utils/TerraSync/terrasync.cxx
Fix for bug #204 and #222 by Bertrand Coconnier; NaNs (bug #222) were basically gener...
[flightgear.git] / utils / TerraSync / terrasync.cxx
index d48e43f775cfbf34a3c3467444fcda56f5fcbfb0..f1a2cc46badab1aaaffa8fccf612bae4babfa32b 100644 (file)
 #include <time.h>
 #include <unistd.h>
 #elif defined(_MSC_VER)
-#include <io.h>
+#   include <io.h>
+#   ifndef HAVE_SVN_CLIENT_H
+#       include <time.h>
+#       include <process.h>
+#   endif
 #endif
 
 #include <stdlib.h>             // atoi() atof() abs() system()
@@ -179,8 +183,10 @@ int mysvn_setup(void) {
     if (err)
         return svn_cmdline_handle_exit_error(err, pool, "terrasync: ");
     mysvn_ctx->auth_baton = ab;
+#if (SVN_VER_MINOR >= 5)
     mysvn_ctx->conflict_func = NULL;
     mysvn_ctx->conflict_baton = NULL;
+#endif
     // Now our magic revisions
     mysvn_rev = (svn_opt_revision_t*) apr_palloc(pool, 
         sizeof(svn_opt_revision_t));
@@ -225,16 +231,31 @@ void sync_tree(const char* dir) {
        if (mysvn_setup() != EXIT_SUCCESS)
            exit(1);
        apr_pool_t *subpool = svn_pool_create(mysvn_pool);
+       
+#if (SVN_VER_MINOR >= 5)
        err = svn_client_checkout3(NULL,
            command,
            dest_base_dir,
            mysvn_rev_peg,
            mysvn_rev,
            svn_depth_infinity,
-           0,
-           0,
+           0, // ignore-externals = false
+           0, // allow unver obstructions = false
            mysvn_ctx,
            subpool);
+#else
+    // version 1.4 API
+    err = svn_client_checkout2(NULL,
+           command,
+           dest_base_dir,
+           mysvn_rev_peg,
+           mysvn_rev,
+           1, // recurse=true - same as svn_depth_infinity for checkout3 above
+           0, // ignore externals = false
+           mysvn_ctx,
+           subpool);
+#endif
+           
        if (err) {
            // Report errors from the checkout attempt
            cout << "failed: " << endl