[MERGE] Inventory-free checkout

Aaron Bentley aaron at aaronbentley.com
Thu Jan 3 21:59:35 GMT 2008


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

John Arbash Meinel wrote:
> Aaron Bentley wrote:
> I also see this comment:
>     # should be deprecated - this is slow and in any case treating them as a
>     # container is (we now know) bad style -- mbp 20070302
>     ## @deprecated_method(zero_fifteen)
>     def __iter__(self):
> 
> So list(wt) should actually be raising a DeprecationError.

I saw that too, but I need that functionality.  So the only reasons to
deprecate it would be to change the name or return type.

> Actually, looking at the implementation, it has to go to
> "self._inventory" and then stat every file in the inventory to see if it
> really does exist.
> 
> So unless list(wt) does something else than list(wt.__iter__()), we
> really need to do something different here.

Well, I was planning on doing

for num, _unused in enumerate(wt):
    if num > 1:
        raise Foo()

But now it's sounding like you think iterating through wt is the wrong API.

Perhaps I should mention that, for reasons I do not understand, the
WorkingTree being passed in has a file-id for .bzrignore, but no file.
So if I were to do iter_all_file_ids, an exception would be raised.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHfVrH0F+nu1YWqI0RAsWvAJ0Wre/FqA414pCDaTmHnlxsk3Zx0wCeOHQI
8XCf2Y7P5D/cC+F4r0TgsdA=
=Cg4z
-----END PGP SIGNATURE-----



More information about the bazaar mailing list