svn commit: r240399 - user/des/svnsup/bin/distill
Dag-Erling Smørgrav
des at FreeBSD.org
Wed Sep 12 13:43:43 UTC 2012
Author: des
Date: Wed Sep 12 13:43:42 2012
New Revision: 240399
URL: http://svn.freebsd.org/changeset/base/240399
Log:
Add support for Subversion 1.7 while retaining backward compatibility
with 1.6.
Modified:
user/des/svnsup/bin/distill/distill.c
user/des/svnsup/bin/distill/distill.h
Modified: user/des/svnsup/bin/distill/distill.c
==============================================================================
--- user/des/svnsup/bin/distill/distill.c Wed Sep 12 13:39:58 2012 (r240398)
+++ user/des/svnsup/bin/distill/distill.c Wed Sep 12 13:43:42 2012 (r240399)
@@ -61,7 +61,11 @@ distill(const char *url, unsigned long r
SVNSUP_APR_ERROR(status, "apr_pool_create()");
/* canonicalize URL */
+#if SVN_VER_MAJOR == 1 && SVN_VER_MINOR < 7
url = svn_path_canonicalize(url, pool);
+#else
+ url = svn_uri_canonicalize(url, pool);
+#endif
/* set up our authentication system */
/* XXX check for errors */
@@ -74,9 +78,22 @@ distill(const char *url, unsigned long r
/* open a connection to the repo */
config = apr_hash_make(pool);
+#if SVN_VER_MAJOR == 1 && SVN_VER_MINOR < 7
error = svn_ra_open3(&ra_session, url, NULL, &ra_callbacks,
NULL, config, pool);
SVNSUP_SVN_ERROR(error, "svn_ra_open3()");
+#else
+ for (;;) {
+ const char *curl = NULL;
+ error = svn_ra_open4(&ra_session, &curl, url, NULL,
+ &ra_callbacks, NULL, config, pool);
+ if (curl == NULL)
+ break;
+ SVNSUP_DEBUG("redirected to %s\n", curl);
+ url = curl;
+ }
+ SVNSUP_SVN_ERROR(error, "svn_ra_open3()");
+#endif
/* get repo uuid */
error = svn_ra_get_uuid2(ra_session, &uuid, pool);
Modified: user/des/svnsup/bin/distill/distill.h
==============================================================================
--- user/des/svnsup/bin/distill/distill.h Wed Sep 12 13:39:58 2012 (r240398)
+++ user/des/svnsup/bin/distill/distill.h Wed Sep 12 13:43:42 2012 (r240399)
@@ -42,6 +42,7 @@
#include <subversion-1/svn_error.h>
#include <subversion-1/svn_path.h>
#include <subversion-1/svn_ra.h>
+#include <subversion-1/svn_version.h>
#include "svnsup/svnsup.h"
More information about the svn-src-user
mailing list