~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

(jelmer) Move get_{workingtree, branch,
 repository}_transport methods from ControlDir to BzrDir. (Jelmer
 Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
929
929
            format = controldir.ControlDirFormat.get_default_format()
930
930
        return format.initialize_on_transport(t)
931
931
 
 
932
    def get_branch_transport(self, branch_format, name=None):
 
933
        """Get the transport for use by branch format in this BzrDir.
 
934
 
 
935
        Note that bzr dirs that do not support format strings will raise
 
936
        IncompatibleFormat if the branch format they are given has
 
937
        a format string, and vice versa.
 
938
 
 
939
        If branch_format is None, the transport is returned with no
 
940
        checking. If it is not None, then the returned transport is
 
941
        guaranteed to point to an existing directory ready for use.
 
942
        """
 
943
        raise NotImplementedError(self.get_branch_transport)
 
944
 
 
945
    def get_repository_transport(self, repository_format):
 
946
        """Get the transport for use by repository format in this BzrDir.
 
947
 
 
948
        Note that bzr dirs that do not support format strings will raise
 
949
        IncompatibleFormat if the repository format they are given has
 
950
        a format string, and vice versa.
 
951
 
 
952
        If repository_format is None, the transport is returned with no
 
953
        checking. If it is not None, then the returned transport is
 
954
        guaranteed to point to an existing directory ready for use.
 
955
        """
 
956
        raise NotImplementedError(self.get_repository_transport)
 
957
 
 
958
    def get_workingtree_transport(self, tree_format):
 
959
        """Get the transport for use by workingtree format in this BzrDir.
 
960
 
 
961
        Note that bzr dirs that do not support format strings will raise
 
962
        IncompatibleFormat if the workingtree format they are given has a
 
963
        format string, and vice versa.
 
964
 
 
965
        If workingtree_format is None, the transport is returned with no
 
966
        checking. If it is not None, then the returned transport is
 
967
        guaranteed to point to an existing directory ready for use.
 
968
        """
 
969
        raise NotImplementedError(self.get_workingtree_transport)
 
970
 
932
971
 
933
972
class BzrDirHooks(hooks.Hooks):
934
973
    """Hooks for BzrDir operations."""