You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2015/01/29 20:27:19 UTC

svn commit: r1655821 - in /subversion/trunk/subversion: libsvn_ra_serf/options.c tests/cmdline/redirect_tests.py

Author: philip
Date: Thu Jan 29 19:27:19 2015
New Revision: 1655821

URL: http://svn.apache.org/r1655821
Log:
Distingush between permanent and temporary redirections to match the
1.8 behaviour.

* subversion/libsvn_ra_serf/options.c
  (svn_ra_serf__exchange_capabilities): Permanent or temporary error.

* subversion/tests/cmdline/redirect_tests.py
  (redirected_copy): Extend with temporary redirect.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/options.c
    subversion/trunk/subversion/tests/cmdline/redirect_tests.py

Modified: subversion/trunk/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/options.c?rev=1655821&r1=1655820&r2=1655821&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/options.c Thu Jan 29 19:27:19 2015
@@ -555,8 +555,9 @@ svn_ra_serf__exchange_capabilities(svn_r
            && 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->sline.code == 301
+                                ? _("Repository moved permanently to '%s'")
+                                : _("Repository moved temporarily to '%s'")),
                               opt_ctx->handler->location);
     }
 

Modified: subversion/trunk/subversion/tests/cmdline/redirect_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/redirect_tests.py?rev=1655821&r1=1655820&r2=1655821&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/redirect_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/redirect_tests.py Thu Jan 29 19:27:19 2015
@@ -212,7 +212,7 @@ def redirected_copy(sbox):
   sbox.build(create_wc=False)
 
   # E170011 = SVN_ERR_RA_SESSION_URL_MISMATCH
-  expected_error = "svn: E170011: The repository.*moved"
+  expected_error = "svn: E170011: Repository moved permanently"
 
   # This tests the actual copy handling
   svntest.actions.run_and_verify_svn(None, None, expected_error,
@@ -226,6 +226,20 @@ def redirected_copy(sbox):
                                      sbox.redirected_root_url() + '/A',
                                      '^/copy-of-A')
 
+  # E170011 = SVN_ERR_RA_SESSION_URL_MISMATCH
+  expected_error = "svn: E170011: Repository moved temporarily"
+
+  # This tests the actual copy handling
+  svntest.actions.run_and_verify_svn(None, None, expected_error,
+                                     'cp', '-m', 'failed copy',
+                                     sbox.redirected_root_url(temporary=True) + '/A',
+                                     sbox.redirected_root_url(temporary=True) + '/A_copied')
+
+  # This tests the cmdline handling of '^/copy-of-A'
+  svntest.actions.run_and_verify_svn(None, None, expected_error,
+                                     'cp', '-m', 'failed copy',
+                                     sbox.redirected_root_url(temporary=True) + '/A',
+                                     '^/copy-of-A')
 #----------------------------------------------------------------------
 
 ########################################################################



RE: svn commit: r1655821 - in /subversion/trunk/subversion: libsvn_ra_serf/options.c tests/cmdline/redirect_tests.py

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Branko Čibej [mailto:brane@wandisco.com]
> Sent: donderdag 29 januari 2015 21:22
> To: commits@subversion.apache.org
> Subject: Re: svn commit: r1655821 - in /subversion/trunk/subversion:
> libsvn_ra_serf/options.c tests/cmdline/redirect_tests.py
> 
> On 29.01.2015 20:27, philip@apache.org wrote:
> > Author: philip
> > Date: Thu Jan 29 19:27:19 2015
> > New Revision: 1655821
> >
> > URL: http://svn.apache.org/r1655821
> > Log:
> > Distingush between permanent and temporary redirections to match the
> > 1.8 behaviour.
> >
> > * subversion/libsvn_ra_serf/options.c
> >   (svn_ra_serf__exchange_capabilities): Permanent or temporary error.
> >
> > * subversion/tests/cmdline/redirect_tests.py
> >   (redirected_copy): Extend with temporary redirect.
> >
> > Modified:
> >     subversion/trunk/subversion/libsvn_ra_serf/options.c
> >     subversion/trunk/subversion/tests/cmdline/redirect_tests.py
> >
> > Modified: subversion/trunk/subversion/libsvn_ra_serf/options.c
> > URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/optio
> ns.c?rev=1655821&r1=1655820&r2=1655821&view=diff
> >
> ================================================================
> ==============
> > --- subversion/trunk/subversion/libsvn_ra_serf/options.c (original)
> > +++ subversion/trunk/subversion/libsvn_ra_serf/options.c Thu Jan 29 19:27:19
> 2015
> > @@ -555,8 +555,9 @@ svn_ra_serf__exchange_capabilities(svn_r
> >             && 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->sline.code == 301
> > +                                ? _("Repository moved permanently to '%s'")
> > +                                : _("Repository moved temporarily to '%s'")),
> >                                opt_ctx->handler->location);
> >      }
> 
> I just noticed that we're probably handling the 307 status incorrectly,
> or not at all.

We only handle permanent redirects (status 301) *as* redirects for the automatic handling, during the opening of a session.
All the other redirect status values are just reported as an error accessing the repository.

	Bert



Re: svn commit: r1655821 - in /subversion/trunk/subversion: libsvn_ra_serf/options.c tests/cmdline/redirect_tests.py

Posted by Branko Čibej <br...@wandisco.com>.
On 29.01.2015 20:27, philip@apache.org wrote:
> Author: philip
> Date: Thu Jan 29 19:27:19 2015
> New Revision: 1655821
>
> URL: http://svn.apache.org/r1655821
> Log:
> Distingush between permanent and temporary redirections to match the
> 1.8 behaviour.
>
> * subversion/libsvn_ra_serf/options.c
>   (svn_ra_serf__exchange_capabilities): Permanent or temporary error.
>
> * subversion/tests/cmdline/redirect_tests.py
>   (redirected_copy): Extend with temporary redirect.
>
> Modified:
>     subversion/trunk/subversion/libsvn_ra_serf/options.c
>     subversion/trunk/subversion/tests/cmdline/redirect_tests.py
>
> Modified: subversion/trunk/subversion/libsvn_ra_serf/options.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/options.c?rev=1655821&r1=1655820&r2=1655821&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_ra_serf/options.c (original)
> +++ subversion/trunk/subversion/libsvn_ra_serf/options.c Thu Jan 29 19:27:19 2015
> @@ -555,8 +555,9 @@ svn_ra_serf__exchange_capabilities(svn_r
>             && 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->sline.code == 301
> +                                ? _("Repository moved permanently to '%s'")
> +                                : _("Repository moved temporarily to '%s'")),
>                                opt_ctx->handler->location);
>      }

I just noticed that we're probably handling the 307 status incorrectly,
or not at all.

-- Brane