~bzr-pqm/bzr/bzr.dev

Viewing all changes in revision 3878.4.1.

  • Committer: Vincent Ladeuil
  • Date: 2008-12-03 16:40:38 UTC
  • mto: (3902.1.1 bzr.integration)
  • mto: This revision was merged to the branch mainline in revision 3903.
  • Revision ID: v.ladeuil+lp@free.fr-20081203164038-5ghthsgdei3ank1j
Fix bug #245964 by preserving decorators during redirections (when
appropriate).

* bzrlib/transport/decorator.py:
(TransportDecorator._redirected_to): Generic implementation
delegating to the _decorated transport.

* bzrlib/transport/http/__init__.py:
(HttpTransportBase.clone): Drive-by fix, deleted, base
implementation was strictly identical.
(HttpTransportBase._redirected_to): Narrow the possible
redirections to those where both urls have the same ending
relpath (to cope with known usages that doesn't respect the 'base'
paradigm (i.e. using '.bzr/smart' instead of 'smart' on a cloned
transport for example). Preserve qualifiers when creating the
redirected transport. Also preserve user if used against the same
host:port (further authentication can invalidate the user if it's
wrong, but if it's required, we'd better propagate it).

* bzrlib/transport/decorator.py:
(TransportDecorator.__init__): Drive-by fix, the url is indeed not
decorated anymore, name the variable accordingly.

* bzrlib/transport/__init__.py:
(Transport._redirected_to): Default do nothing implementation.

* bzrlib/tests/test_bzrdir.py:
(TestHTTPRedirections.test_qualifier_preserved): Ensures that
qualifiers are preserved across redirections.

* bzrlib/bzrdir.py:
(BzrDir.open_from_transport.redirected): Delegate redirection
handling to the transport.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: