/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/remote.py

  • Committer: Robert Collins
  • Date: 2009-03-03 03:27:51 UTC
  • mto: (4070.2.5 integration)
  • mto: This revision was merged to the branch mainline in revision 4075.
  • Revision ID: robertc@robertcollins.net-20090303032751-ubyfhezgjul6y5ic
Get BzrDir.cloning_metadir working.

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
            raise errors.UnexpectedSmartServerResponse(response)
113
113
        if response == ('no',):
114
114
            raise errors.NotBranchError(path=transport.base)
115
 
        self._ensure_real()
116
115
 
117
116
    def _ensure_real(self):
118
117
        """Ensure that there is a _real_bzrdir set.
134
133
        self._next_open_branch_result = None
135
134
        return BzrDir.break_lock(self)
136
135
 
137
 
    def cloning_metadir(self, stacked=False):
 
136
    def _vfs_cloning_metadir(self, require_stacking=False):
138
137
        self._ensure_real()
139
 
        return self._real_bzrdir.cloning_metadir(stacked)
 
138
        return self._real_bzrdir.cloning_metadir(
 
139
            require_stacking=require_stacking)
 
140
 
 
141
    def cloning_metadir(self, require_stacking=False):
 
142
        medium = self._client._medium
 
143
        if medium._is_remote_before((1, 13)):
 
144
            return self._vfs_cloning_metadir(require_stacking=require_stacking)
 
145
        verb = 'BzrDir.cloning_metadir'
 
146
        if require_stacking:
 
147
            stacking = 'True'
 
148
        else:
 
149
            stacking = 'False'
 
150
        path = self._path_for_remote_call(self._client)
 
151
        try:
 
152
            response = self._call(verb, path, stacking)
 
153
        except errors.UnknownSmartMethod:
 
154
            return self._vfs_cloning_metadir(require_stacking=require_stacking)
 
155
        if len(response) != 3:
 
156
            raise errors.UnexpectedSmartServerResponse(response)
 
157
        control_name, repo_name, branch_name = response
 
158
        format = bzrdir.network_format_registry.get(control_name)
 
159
        if repo_name:
 
160
            format.repository_format = repository.network_format_registry.get(
 
161
                repo_name)
 
162
        if branch_name:
 
163
            format.set_branch_format(
 
164
                branch.network_format_registry.get(branch_name))
 
165
        return format
140
166
 
141
167
    def create_repository(self, shared=False):
142
168
        # as per meta1 formats - just delegate to the format object which may