You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/01/29 14:25:26 UTC
svn commit: r1655648 - in /subversion/trunk/subversion:
libsvn_ra/ra_loader.c libsvn_ra_serf/options.c libsvn_ra_serf/util.c
tests/cmdline/redirect_tests.py
Author: rhuijben
Date: Thu Jan 29 13:25:26 2015
New Revision: 1655648
URL: http://svn.apache.org/r1655648
Log:
Make svn_ra_open_session4() behave as documented during 1.7 development
(but as it was never implemented before), by returning the documented
error when a repository should be opened in a different location.
* subversion/libsvn_ra/ra_loader.c
(svn_ra_open4): Don't wrap SVN_ERR_RA_SESSION_URL_MISMATCH errors.
* subversion/libsvn_ra_serf/options.c
(svn_ra_serf__exchange_capabilities): Always handle HTTP 3XX status values
here.
* subversion/libsvn_ra_serf/util.c
(svn_ra_serf__error_on_status): Remove bad advice.
* subversion/tests/cmdline/redirect_tests.py
(redirected_copy): Update expected result.
Modified:
subversion/trunk/subversion/libsvn_ra/ra_loader.c
subversion/trunk/subversion/libsvn_ra_serf/options.c
subversion/trunk/subversion/libsvn_ra_serf/util.c
subversion/trunk/subversion/tests/cmdline/redirect_tests.py
Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.c?rev=1655648&r1=1655647&r2=1655648&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.c Thu Jan 29 13:25:26 2015
@@ -486,10 +486,15 @@ svn_error_t *svn_ra_open4(svn_ra_session
callbacks, callback_baton, config, sesspool);
if (err)
- return svn_error_createf(
+ {
+ if (err->apr_err == SVN_ERR_RA_SESSION_URL_MISMATCH)
+ return svn_error_trace(err);
+
+ return svn_error_createf(
SVN_ERR_RA_CANNOT_CREATE_SESSION, err,
_("Unable to connect to a repository at URL '%s'"),
repos_URL);
+ }
/* If the session open stuff detected a server-provided URL
correction (a 301 or 302 redirect response during the initial
Modified: subversion/trunk/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/options.c?rev=1655648&r1=1655647&r2=1655648&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/options.c Thu Jan 29 13:25:26 2015
@@ -512,8 +512,7 @@ svn_ra_serf__exchange_capabilities(svn_r
/* This routine automatically fills in serf_sess->capabilities */
SVN_ERR(create_options_req(&opt_ctx, serf_sess, scratch_pool));
- if (corrected_url)
- opt_ctx->handler->no_fail_on_http_redirect_status = TRUE;
+ opt_ctx->handler->no_fail_on_http_redirect_status = TRUE;
SVN_ERR(svn_ra_serf__context_run_one(opt_ctx->handler, scratch_pool));
@@ -552,6 +551,14 @@ svn_ra_serf__exchange_capabilities(svn_r
return SVN_NO_ERROR;
}
+ else if (opt_ctx->handler->sline.code >= 300
+ && opt_ctx->handler->sline.code < 399)
+ {
+ return svn_error_createf(SVN_ERR_RA_SESSION_URL_MISMATCH, NULL,
+ _("The repository reports that it was moved "
+ "to '%s'"),
+ opt_ctx->handler->location);
+ }
if (opt_ctx->handler->sline.code != 200)
return svn_error_trace(svn_ra_serf__unexpected_status(opt_ctx->handler));
Modified: subversion/trunk/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/util.c?rev=1655648&r1=1655647&r2=1655648&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/util.c Thu Jan 29 13:25:26 2015
@@ -1751,10 +1751,9 @@ svn_ra_serf__error_on_status(serf_status
case 308:
return svn_error_createf(SVN_ERR_RA_DAV_RELOCATED, NULL,
(sline.code == 301)
- ? _("Repository moved permanently to '%s';"
- " please relocate")
- : _("Repository moved temporarily to '%s';"
- " please relocate"), location);
+ ? _("Repository moved permanently to '%s'")
+ : _("Repository moved temporarily to '%s'"),
+ location);
case 403:
return svn_error_createf(SVN_ERR_RA_DAV_FORBIDDEN, NULL,
_("Access to '%s' forbidden"), path);
Modified: subversion/trunk/subversion/tests/cmdline/redirect_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/redirect_tests.py?rev=1655648&r1=1655647&r2=1655648&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/redirect_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/redirect_tests.py Thu Jan 29 13:25:26 2015
@@ -211,15 +211,16 @@ def redirected_copy(sbox):
sbox.build(create_wc=False)
+ # E170011 = SVN_ERR_RA_SESSION_URL_MISMATCH
+ expected_error = "svn: E170011: The repository.*moved"
+
# This tests the actual copy handling
- expected_error = "svn: E175011: Repository moved permanently"
svntest.actions.run_and_verify_svn(None, None, expected_error,
'cp', '-m', 'failed copy',
sbox.redirected_root_url() + '/A',
sbox.redirected_root_url() + '/A_copied')
# This tests the cmdline handling of '^/copy-of-A'
- expected_error = "svn: E155007: Resolving '\^/': no repository root found"
svntest.actions.run_and_verify_svn(None, None, expected_error,
'cp', '-m', 'failed copy',
sbox.redirected_root_url() + '/A',