/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: Andrew Bennetts
  • Date: 2008-03-12 20:13:07 UTC
  • mfrom: (3267 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080312201307-ngd5bynt2nvhnlb7
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
                
149
149
    def open_repository(self):
150
150
        path = self._path_for_remote_call(self._client)
151
 
        response = self._client.call('BzrDir.find_repository', path)
 
151
        verb = 'BzrDir.find_repositoryV2'
 
152
        response = self._client.call(verb, path)
 
153
        if (response == ('error', "Generic bzr smart protocol error: "
 
154
                "bad request '%s'" % verb) or
 
155
              response == ('error', "Generic bzr smart protocol error: "
 
156
                "bad request u'%s'" % verb)):
 
157
            verb = 'BzrDir.find_repository'
 
158
            response = self._client.call(verb, path)
152
159
        assert response[0] in ('ok', 'norepository'), \
153
160
            'unexpected response code %s' % (response,)
154
161
        if response[0] == 'norepository':
155
162
            raise errors.NoRepositoryPresent(self)
156
 
        assert len(response) == 4, 'incorrect response length %s' % (response,)
 
163
        if verb == 'BzrDir.find_repository':
 
164
            # servers that don't support the V2 method don't support external
 
165
            # references either.
 
166
            response = response + ('no', )
 
167
        assert len(response) == 5, 'incorrect response length %s' % (response,)
157
168
        if response[1] == '':
158
169
            format = RemoteRepositoryFormat()
159
170
            format.rich_root_data = (response[2] == 'yes')
160
171
            format.supports_tree_reference = (response[3] == 'yes')
 
172
            # No wire format to check this yet.
 
173
            format.supports_external_lookups = (response[4] == 'yes')
161
174
            return RemoteRepository(self, format)
162
175
        else:
163
176
            raise errors.NoRepositoryPresent(self)