Rev 2127: More missing methods from RemoteBranch and RemoteRepository to let 'info' get further. in file:///home/robertc/source/baz/hpss/
Robert Collins
robertc at robertcollins.net
Sat Feb 3 10:10:02 GMT 2007
------------------------------------------------------------
revno: 2127
revision-id: robertc at robertcollins.net-20070203100954-vucxltziwzgkkyw0
parent: robertc at robertcollins.net-20070202192520-3fecwesz5o3hb0fo
committer: Robert Collins <robertc at robertcollins.net>
branch nick: hpss
timestamp: Sat 2007-02-03 21:09:54 +1100
message:
More missing methods from RemoteBranch and RemoteRepository to let 'info' get further.
modified:
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py 2007-02-02 19:25:20 +0000
+++ b/bzrlib/remote.py 2007-02-03 10:09:54 +0000
@@ -92,7 +92,8 @@
# This branch accessed through the smart server, so wrap the
# file-level objects.
real_repository = real_branch.repository
- remote_repository = RemoteRepository(self, real_repository)
+ assert isinstance(real_repository.bzrdir, RemoteBzrDir)
+ remote_repository = RemoteRepository(real_repository.bzrdir, real_repository)
return RemoteBranch(self, remote_repository, real_branch)
else:
# otherwise just create a proxy for the branch.
@@ -202,6 +203,10 @@
assert response[0] in ('ok', 'no'), 'unexpected response code %s' % (response,)
return response[0] == 'ok'
+ def get_physical_lock_status(self):
+ """See Repository.get_physical_lock_status()."""
+ return False
+
def is_shared(self):
"""See Repository.is_shared()."""
path = self.bzrdir._path_for_remote_call(self._client)
@@ -209,6 +214,24 @@
assert response[0] in ('yes', 'no'), 'unexpected response code %s' % (response,)
return response[0] == 'yes'
+ def lock_read(self):
+ # wrong eventually - want a local lock cache context
+ return self._real_repository.lock_read()
+
+ def lock_write(self):
+ # definately wrong: want to check if there is a real repo
+ # and not thunk through if not
+ return self._real_repository.lock_write()
+
+ def unlock(self):
+ # should free cache context.
+ return self._real_repository.unlock()
+
+ def break_lock(self):
+ # should hand off to the network - or better yet, we should not
+ # allow stale network locks ?
+ return self._real_repository.break_lock()
+
class RemoteBranchLockableFiles(object):
"""A 'LockableFiles' implementation that talks to a smart server.
@@ -236,6 +259,9 @@
class RemoteBranchFormat(branch.BranchFormat):
+ def get_format_description(self):
+ return 'Remote BZR Branch'
+
def open(self, a_bzrdir):
assert isinstance(a_bzrdir, RemoteBzrDir)
return a_bzrdir.open_branch()
@@ -272,6 +298,11 @@
self.base = self.bzrdir.root_transport.base
self.control_files = RemoteBranchLockableFiles(self.bzrdir, self._client)
+ def get_physical_lock_status(self):
+ """See Branch.get_physical_lock_status()."""
+ # should be an API call to the server, as branches must be lockable.
+ return self._real_branch.get_physical_lock_status()
+
def lock_read(self):
return self._real_branch.lock_read()
More information about the bazaar-commits
mailing list