[MERGE] Inventory.iter_just_entries()

Ian Clatworthy ian.clatworthy at internode.on.net
Tue Mar 17 05:40:10 GMT 2009


John Arbash Meinel wrote:

> My main concern is that this is a very arbitrary order, which isn't
> particularly stable. Both 'iter_entries()' and 'iter_entries_by_dir()'
> have a very defined order based on the path.

Right. The docstring makes it clear that the order is whatever the
implementation chooses as being most efficient. One can always either
sort or fall back to using iter_entries() or iter_entries_by_dir().
There's also an entries() method but it seems less useful given it
explicitly leaves out the root.

> Do you have a specific use case for this that we can evaluate? I know
> you mentioned it earlier. You can just give me the name of that thread
> if it is easier.

In brisbane-core, examples include:

* pack_repo.find_text_key_references()
* pack_repo.fileids_altered_by_revision_ids()

In bzr.dev, Repository._install_revisions() is another example.

I strongly agree that iter_just_entries() shouldn't be used without
careful consideration in each case. That's part of the reason why
I didn't make changes throughout the codebase to begin using it
in this patch. I do feel however that generating data that isn't
needed is generally wasteful so we need some way of avoiding that in
the inventory API.

Ian C.




More information about the bazaar mailing list