[merge][0.11] 'bzr inventory filename'
John Arbash Meinel
john at arbash-meinel.com
Fri Sep 22 22:46:02 BST 2006
Aaron Bentley wrote:
> John Arbash Meinel wrote:
>>> - for path, entry in inv.entries():
>>> + if file_list:
>>> + entries = [(path, inv[inv.path2id(path)]) for path in file_list]
>
> This looks wrong; the paths the user provides are relative to the CWD,
> but you're treating them as though they're relative to the tree root.
>
> I suggest using tree_files, like so:
>
> tree, file_list = tree_files(file_list)
>
> That will give you our standard behaviour, and allow you to invoke
> inventory on a tree other than one containing the CWD.
...
Thanks for the feedback. I have now revised 'bzr inventory' to be quite
robust in cases like this. Including handling the '--revision'
parameter, and all sorts of niceties.
> It probably wouldn't hurt to write a helper that combined the two:
>
> def tree_file_ids(file_list, default_branch='.',
> require_versioned=True):
I didn't write the helper, because it turns out that we need more that
the basic functionality, because we can pass --revision. Also, when I
started digging into it, it looks like we need to revise some apis.
(internal_tree_files should be moved, etc, etc). And that requires
deprecations, which would be too late for an 0.12 release.
I'm attaching the whole diff, since I think it will make the most sense
in context.
Does anyone know why we want '--kind'? It doesn't really seem useful,
and it might be nice to deprecate it. Because then we wouldn't need to
extract inventory entries, just file ids.
I'm just attaching the diff, because the bundle is getting big. But you
can get the branch at:
http://bzr.arbash-meinel.com/branches/bzr/0.11-bugfix/inventory-takes-file-3631
So Aaron, are you happy with this?
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inventory-takes-file-3631.diff
Type: text/x-patch
Size: 9774 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060922/155636ea/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060922/155636ea/attachment.pgp
More information about the bazaar
mailing list