hpss a little too friendly

Martin Pool mbp at sourcefrog.net
Mon Jul 30 16:47:58 BST 2007


On 7/27/07, John Arbash Meinel <john at arbash-meinel.com> wrote:
> So I played around with the '-Dhpss' flag, and one thing I found is that we are
> issuing a 'hello' command a little too often.
>
> Specifically, for a single 'commit', we say 'hello' 5 times.

It might be nice to also log a summary at the end like strace -c
giving the number of calls and the time...

> Actually, looking closer, it seems to be that we are placing a
> "BzrDir.open_branch" remote call, (so that we can determine if there is a
> branch reference on the remote side).
> And then we ignore that and return RemoteBranch(self, self.find_repository())
> ignoring the fact that the open_branch() call returns where the repository is
> located.
> The really confusing part is that
> RemoteBzrDir.open_branch() *doesn't* actually call "BzrDir.open_branch()", and
> sort of does all the work locally.
>
> Is there a reason the code couldn't be:
>
> def open_branch(self, _unsupported=False):
>   path = self._path_for_remote_call(self._client)
>   response = self._client.call('BzrDir.open_branch', path)
>   if response[0] == 'ok':
>     if response[1] == '':
>         return RemoteBranch(self, self.find_repository())
> ...
>
> and then we would want
>
> def find_repository(self):
>     path = self._path_for_remote_call(self._client)
>     response = self._client.call('BzrDir.find_repository', path)
>     if response[0] == 'ok':
>       remote_path = response[1]
>       format = RemoteRepositoryFormat()
>       format.rich_root_data = (response[2] == 'yes')
>       format.supports_tree_reference = (response[3] == 'yes')
>       return RemoteRepository(self, format)
>
> Is it just that 'self' is pointing to the wrong BzrDir at that point, so we
> actually need to create a new RemoteBzrDir based on the remote path.

That looks reasonable to me.  You could file a bug for this if you
don't have a patch already.

-- 
Martin



More information about the bazaar mailing list