/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: v.ladeuil+lp at free
  • Date: 2007-01-09 15:33:36 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-20070109153336-8iucozbcxmpb1az6
First implementation of transport hints.

* bzrlib/tests/test_transport_hints.py: 
New file.

* bzrlib/transport/__init__.py:
(TransportHints, TransportGetHints): New hints classes.
(Transport.create_get_hints): New method creating a suitable hints
object.

* bzrlib/tests/__init__.py:
(test_suite): Add test_transport_hints.

* bzrlib/errors.py:
(RedirectRequested.__init__): Fix typo.
(UnknownHint): New exception class.

* bzrlib/bzrdir.py:
(BzrDirFormat.probe_transport): Pass a hints object to
transport.get.

Show diffs side-by-side

added added

removed removed

Lines of Context:
509
509
        :param transport: Transport containing the bzrdir.
510
510
        :param _unsupported: private.
511
511
        """
512
 
        # FIXME: Put that outside the static method once I
513
 
        # understand how to do it.
514
 
 
515
512
        initial_base = transport.base
516
513
        redirected = True # to enter the loop
517
514
        redirections = 0
1103
1100
    def probe_transport(klass, transport):
1104
1101
        """Return the .bzrdir style transport present at URL."""
1105
1102
        try:
1106
 
            format_file = transport.get(".bzr/branch-format",
1107
 
                                        follow_redirections=False)
 
1103
            hints = transport.create_get_hints(follow_redirections=False)
 
1104
            format_file = transport.get(".bzr/branch-format",**hints)
1108
1105
            format_string = format_file.read()
1109
1106
        except errors.NoSuchFile:
1110
1107
            raise errors.NotBranchError(path=transport.base)