[PATCH] fix bound branch SFTP test speed, and optimise somewhat.

Robert Collins robertc at robertcollins.net
Mon Mar 27 08:10:14 BST 2006


On Mon, 2006-03-27 at 12:09 +1000, Andrew Bennetts wrote:
> On Sun, Mar 26, 2006 at 07:50:09AM +1100, Robert Collins wrote:
> [...]
> > === modified file 'a/bzrlib/transport/sftp.py'
> > --- a/bzrlib/transport/sftp.py	
> > +++ b/bzrlib/transport/sftp.py	
> > @@ -183,6 +183,14 @@
> >  # sort of expiration policy, such as disconnect if inactive for
> >  # X seconds. But that requires a lot more fanciness.
> >  _connected_hosts = weakref.WeakValueDictionary()
> > +
> > +def clear_connection_cache():
> > +    """Remove all hosts from the SFTP connection cache.
> > +
> > +    Primarily useful for test cases wanting to force garbage collection.
> > +    """
> > +    while _connected_hosts:
> > +        _connected_hosts.popitem()
> >  
> >  
> >  def load_host_keys():
> > 
> 
> This part will fix https://launchpad.net/products/bzr/+bug/36294, so I hope this
> gets merged :)
> 
> I don't know why the body of this method isn't simply _connected_hosts.clear(),
> though.

my bad, I keep forgetting that the dict protocol is non trivially
different to lists. Changing this.

Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060327/a29372a9/attachment.pgp 


More information about the bazaar mailing list