~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Vincent Ladeuil
  • Date: 2007-03-01 21:26:57 UTC
  • mto: (2323.7.1 redirection)
  • mto: This revision was merged to the branch mainline in revision 2390.
  • Revision ID: v.ladeuil+lp@free.fr-20070301212657-bclmihdfnxgfy0sw
Take Aaron's review comments into account.

* bzrlib/transport/http/_urllib2_wrappers.py:
(HTTPRedirectHandler.http_error_301): Fix bug #88780.

* bzrlib/transport/http/__init__.py:
(HttpTransportBase._get): Fix doc string.

* bzrlib/transport/__init__.py:
(do_catching_redirections): Raise TooManyRedirections instead of
requiring an exception as a parameter.

* bzrlib/tests/test_http.py:
(TestHTTPRedirections.setUp): Simplified.
(TestHTTPRedirections.test_read_redirected_bundle_from_url): New test.
(TestDoCatchRedirections): New tests.

* bzrlib/tests/HTTPTestUtil.py:
(TestCaseWithRedirectedWebserver): New class factored out from
test_http.TestHTTPRedirections.

* bzrlib/errors.py:
(TooManyRedirections): New exception.

* bzrlib/bzrdir.py:
(BzrDir.open_from_transport.redirected): Catch TooManyRedirections.

* bzrlib/bundle/__init__.py:
(read_bundle_from_url.redirected_transport): Catch TooManyRedirections.

Show diffs side-by-side

added added

removed removed

Lines of Context:
527
527
                 transport.base, e.permanently, target)
528
528
            # Let's try with a new transport
529
529
            qualified_target = e.get_target_url()[:-len(relpath)]
530
 
            # FIXME: If 'transport' have a qualifier, this should
 
530
            # FIXME: If 'transport' has a qualifier, this should
531
531
            # be applied again to the new transport *iff* the
532
532
            # schemes used are the same. It's a bit tricky to
533
533
            # verify, so I'll punt for now
534
534
            # -- vila20070212
535
535
            return get_transport(target)
536
536
 
537
 
        transport, format = do_catching_redirections(
538
 
            find_format, transport, redirected, errors.NotBranchError(base))
 
537
        try:
 
538
            transport, format = do_catching_redirections(find_format, transport,
 
539
                                                         redirected)
 
540
        except errors.TooManyRedirections:
 
541
            raise errors.NotBranchError(base)
539
542
 
540
543
        BzrDir._check_supported(format, _unsupported)
541
544
        return format.open(transport, _found=True)