[MERGE] Make {BzrDir,Repository}.find_branches a generator.

John Arbash Meinel john at arbash-meinel.com
Wed Apr 9 08:52:02 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Bennetts wrote:
| This patch simply changes BzrDir.find_branches and Repository.find_branches to
| be generators, rather than functions that return lists.  This allows the callers
| to get incremental results.
|
| I did this because I use “bzr merged-branches” (from
| https://launchpad.net/bzr-removable).  This patch makes that command feel much
| faster, because it starts giving output much much sooner.
|
| -Andrew.

I think it would be nice if the api was such that it *could* be a generator, and
that the smart version would just use a list to implement it. Because I agree
with Robert that you don't want Network code around a generator (which may not
be consumed, failures at odd times, etc), but when you have 50 branches on disk,
it is nice to start working once you find the first one.

So...

BB:tweak

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/HWiJdeBCYSNAAMRAkEhAKCRBig6jMXedlw31pwv9m84I3HADACfQ9Wl
V6b4yhOxmqNFWdx85To+QJk=
=3zjG
-----END PGP SIGNATURE-----




More information about the bazaar mailing list