~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Martin Pool
  • Date: 2006-06-20 05:32:16 UTC
  • mfrom: (1797 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1798.
  • Revision ID: mbp@sourcefrog.net-20060620053216-817857d7ca3e9d1f
[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
directories.
21
21
"""
22
22
 
 
23
# TODO: remove unittest dependency; put that stuff inside the test suite
 
24
 
23
25
from copy import deepcopy
24
26
from cStringIO import StringIO
25
27
import os
92
94
        """
93
95
        if not allow_unsupported and not format.is_supported():
94
96
            # see open_downlevel to open legacy branches.
95
 
            raise errors.UnsupportedFormatError(
96
 
                    'sorry, format %s not supported' % format,
97
 
                    ['use a different bzr version',
98
 
                     'or remove the .bzr directory'
99
 
                     ' and "bzr init" again'])
 
97
            raise errors.UnsupportedFormatError(format=format)
100
98
 
101
99
    def clone(self, url, revision_id=None, basis=None, force_new_repo=False):
102
100
        """Clone this bzrdir and its contents to url verbatim.
972
970
        """Return the .bzrdir style transport present at URL."""
973
971
        try:
974
972
            format_string = transport.get(".bzr/branch-format").read()
 
973
        except errors.NoSuchFile:
 
974
            raise errors.NotBranchError(path=transport.base)
 
975
 
 
976
        try:
975
977
            return klass._formats[format_string]
976
 
        except errors.NoSuchFile:
977
 
            raise errors.NotBranchError(path=transport.base)
978
978
        except KeyError:
979
 
            raise errors.UnknownFormatError(format_string)
 
979
            raise errors.UnknownFormatError(format=format_string)
980
980
 
981
981
    @classmethod
982
982
    def get_default_format(klass):