/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

More missing methods from RemoteBranch and RemoteRepository to let 'info' get further.

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
                # This branch accessed through the smart server, so wrap the
93
93
                # file-level objects.
94
94
                real_repository = real_branch.repository
95
 
                remote_repository = RemoteRepository(self, real_repository)
 
95
                assert isinstance(real_repository.bzrdir, RemoteBzrDir)
 
96
                remote_repository = RemoteRepository(real_repository.bzrdir, real_repository)
96
97
                return RemoteBranch(self, remote_repository, real_branch)
97
98
            else:
98
99
                # otherwise just create a proxy for the branch.
202
203
        assert response[0] in ('ok', 'no'), 'unexpected response code %s' % (response,)
203
204
        return response[0] == 'ok'
204
205
 
 
206
    def get_physical_lock_status(self):
 
207
        """See Repository.get_physical_lock_status()."""
 
208
        return False
 
209
 
205
210
    def is_shared(self):
206
211
        """See Repository.is_shared()."""
207
212
        path = self.bzrdir._path_for_remote_call(self._client)
209
214
        assert response[0] in ('yes', 'no'), 'unexpected response code %s' % (response,)
210
215
        return response[0] == 'yes'
211
216
 
 
217
    def lock_read(self):
 
218
        # wrong eventually - want a local lock cache context
 
219
        return self._real_repository.lock_read()
 
220
 
 
221
    def lock_write(self):
 
222
        # definately wrong: want to check if there is a real repo
 
223
        # and not thunk through if not
 
224
        return self._real_repository.lock_write()
 
225
 
 
226
    def unlock(self):
 
227
        # should free cache context.
 
228
        return self._real_repository.unlock()
 
229
 
 
230
    def break_lock(self):
 
231
        # should hand off to the network - or better yet, we should not
 
232
        # allow stale network locks ?
 
233
        return self._real_repository.break_lock()
 
234
 
212
235
 
213
236
class RemoteBranchLockableFiles(object):
214
237
    """A 'LockableFiles' implementation that talks to a smart server.
236
259
 
237
260
class RemoteBranchFormat(branch.BranchFormat):
238
261
 
 
262
    def get_format_description(self):
 
263
        return 'Remote BZR Branch'
 
264
 
239
265
    def open(self, a_bzrdir):
240
266
        assert isinstance(a_bzrdir, RemoteBzrDir)
241
267
        return a_bzrdir.open_branch()
272
298
        self.base = self.bzrdir.root_transport.base
273
299
        self.control_files = RemoteBranchLockableFiles(self.bzrdir, self._client)
274
300
 
 
301
    def get_physical_lock_status(self):
 
302
        """See Branch.get_physical_lock_status()."""
 
303
        # should be an API call to the server, as branches must be lockable.
 
304
        return self._real_branch.get_physical_lock_status()
 
305
 
275
306
    def lock_read(self):
276
307
        return self._real_branch.lock_read()
277
308