[merge] avoid RemoteLockableFiles special handling of branch.conf (and query: purpose of Branch.get_config_file rpc)

Martin Pool mbp at canonical.com
Tue May 6 13:37:03 BST 2008


After setting out to ask a question about this code I have convinced
myself that it's dead and should be removed.  Here's the question
first:

RemoteBranchLockableFiles has a special case that when retrieving the
branch.conf file, it sends a special rpc rather than a regular file
rpc.  This seems to have no net effect at present as the server just
gets the file from its backing transport.  Is this used by something
in Launchpad, or was it a step towards removing vfs-based access?

There is a test TestBranchControlGetBranchConf that the LockableFiles
does trap access to this file, but it's not clear to me this hook is
effective in practice, because this file seems to normally be accessed
through a TransportConfig, which bypasses the LockableFiles
altogether.  It's never hit in running the test suite.

So for now I'm inclined to remove the special case from
RemoteBranchLockableFiles, while of course leaving it supported on the
server in case old clients call it.

In the future if we want to disable vfs methods we would need a way to
get a branch's configuration.  I think that should be explicitly
handled at the Branch level: either giving it a
get_branch_conf_bytes() method (which locally just reads the file), or
perhaps inverting control and giving it a method to give you back a
Config object.

-- 
Martin <http://launchpad.net/~mbp/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20080506-remotebranchlockablefiles.diff
Type: text/x-diff
Size: 3982 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080506/35a944f2/attachment-0001.bin 


More information about the bazaar mailing list