~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: John Arbash Meinel
  • Date: 2007-04-26 18:53:33 UTC
  • mfrom: (2465 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2466.
  • Revision ID: john@arbash-meinel.com-20070426185333-i1xlyaeyf049kdxc
[merge] bzr.dev 2465

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
    sha_string,
58
58
    )
59
59
from bzrlib.smart.client import _SmartClient
 
60
from bzrlib.smart import protocol
60
61
from bzrlib.store.revision.text import TextRevisionStore
61
62
from bzrlib.store.text import TextStore
62
63
from bzrlib.store.versioned import WeaveStore
781
782
            result.create_repository()
782
783
        elif source_repository is not None and result_repo is None:
783
784
            # have source, and want to make a new target repo
784
 
            # we don't clone the repo because that preserves attributes
785
 
            # like is_shared(), and we have not yet implemented a 
786
 
            # repository sprout().
787
 
            result_repo = result.create_repository()
788
 
        if result_repo is not None:
 
785
            result_repo = source_repository.sprout(result, revision_id=revision_id)
 
786
        else:
789
787
            # fetch needed content into target.
790
788
            if source_repository is not None:
 
789
                # would rather do 
 
790
                # source_repository.copy_content_into(result_repo, revision_id=revision_id)
 
791
                # so we can override the copy method
791
792
                result_repo.fetch(source_repository, revision_id=revision_id)
792
793
        if source_branch is not None:
793
794
            source_branch.sprout(result, revision_id=revision_id)
2232
2233
    def probe_transport(klass, transport):
2233
2234
        """Return a RemoteBzrDirFormat object if it looks possible."""
2234
2235
        try:
2235
 
            transport.get_smart_client()
 
2236
            client = transport.get_smart_client()
2236
2237
        except (NotImplementedError, AttributeError,
2237
2238
                errors.TransportNotPossible):
2238
2239
            # no smart server, so not a branch for this format type.
2239
2240
            raise errors.NotBranchError(path=transport.base)
2240
2241
        else:
 
2242
            # Send a 'hello' request in protocol version one, and decline to
 
2243
            # open it if the server doesn't support our required version (2) so
 
2244
            # that the VFS-based transport will do it.
 
2245
            request = client.get_request()
 
2246
            smart_protocol = protocol.SmartClientRequestProtocolOne(request)
 
2247
            server_version = smart_protocol.query_version()
 
2248
            if server_version != 2:
 
2249
                raise errors.NotBranchError(path=transport.base)
2241
2250
            return klass()
2242
2251
 
2243
2252
    def initialize_on_transport(self, transport):