[merge][0.11] 'bzr inventory filename'

Aaron Bentley aaron.bentley at utoronto.ca
Sat Sep 23 05:40:05 BST 2006

Hash: SHA1

John Arbash Meinel wrote:
> Aaron Bentley wrote:
> 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.

Very nice.  +1

> 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.

I agree about that need.  I had a look at revising the argument handling
for 'cat', but chickened out, because I could see so much I wanted to
fix.  cat has almost exactly the same needs as inventory, but for a
single file.

> (internal_tree_files should be moved, etc, etc). And that requires
> deprecations, which would be too late for an 0.12 release.

You mean 0.11?

> 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.

Actually, I thought we were going to abandon inventory (and unknowns,
ignored) in favor of ls.  But I can imagine wanting to run a script
against all source files, for example.

> +            # We include work_tree as well as 'tree' here
> +            # So that doing '-r 10 path/foo' will lookup whatever file
> +            # exists now at 'path/foo' even if it has been renamed, as
> +            # well as whatever files existed in revision 10 at path/foo
> +            trees = [tree, work_tree]
> +        else:
> +            tree = work_tree
> +            trees = [tree]
> +
> +        if file_list:

I'd prefer "if file_list is not None" here.  In my mind, there's a huge
difference between [] and None.  [] means "no files" and None means
"unspecified, so all files".

I admit that in this case, it's impossible for the user to provide a []
file list, but I think it's good form.  Remember, I just fixed
delta._compare_trees by converting "while foo" to "while foo is not None".

> +            # find_ids_across_trees may include some paths that don't
> +            # exist in 'tree'.

Perhaps find_ids_across_trees should be able to restrict the output to
files occurring in a given tree.

Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the bazaar mailing list