On 04/21/2011 05:14 PM, Jelmer Vernooij wrote:
> On Thu, 2011-04-21 at 17:04 +0200, John Arbash Meinel wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 04/21/2011 03:18 PM, John A Meinel wrote:
>>> Since the trees expose "iter_entries_by_dir()" why not give them an
>>> _get_inventory method rather than all of these clumsy workarounds?
>>>
>>
>> Sending this to you directly, since otherwise it probably gets lost in
>> the 100s of bug spam I just generated.
> Thanks.
>
> all trees have iter_entries_by_dir(), but only some actually have an
> inventory and the related methods (get_canonical_inventory_path,
> _write_inventory, read_working_inventory, etc).
But if you have iter_entries_by_dir, you would have:
byid = dict((ie.file_id, ie) for _, ie in self.iter_entries_by_dir())
inv = Inventory()
inv._byid = byid
inv.root = X
Or something not to far removed from that.
I don't think we need _write_inventory, read_working_inventory can just
do the above, etc.
>
> A _get_inventory() method on tree would require a fair amount of extra
> work for foreign trees. It would allow us to keep check_inventory_shape
> vs check_tree_shape, but would not prevent any of the places where
> TestNotApplicable is raised (all for _write_inventory,
> get_canonical_inventory_path, etc).
>
> Cheers,
>
> Jelmer
It seems you are adding a lot more places than just that, but I'll admit
I'm not looking directly at the code.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04/21/2011 05:14 PM, Jelmer Vernooij wrote: by_dir( )" why not give them an by_dir( ), but only some actually have an inventory_ path, inventory, etc).
> On Thu, 2011-04-21 at 17:04 +0200, John Arbash Meinel wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 04/21/2011 03:18 PM, John A Meinel wrote:
>>> Since the trees expose "iter_entries_
>>> _get_inventory method rather than all of these clumsy workarounds?
>>>
>>
>> Sending this to you directly, since otherwise it probably gets lost in
>> the 100s of bug spam I just generated.
> Thanks.
>
> all trees have iter_entries_
> inventory and the related methods (get_canonical_
> _write_inventory, read_working_
But if you have iter_entries_ by_dir, you would have:
byid = dict((ie.file_id, ie) for _, ie in self.iter_ entries_ by_dir( ))
inv = Inventory()
inv._byid = byid
inv.root = X
Or something not to far removed from that.
I don't think we need _write_inventory, read_working_ inventory can just
do the above, etc.
> _shape inventory_ path, etc).
> A _get_inventory() method on tree would require a fair amount of extra
> work for foreign trees. It would allow us to keep check_inventory
> vs check_tree_shape, but would not prevent any of the places where
> TestNotApplicable is raised (all for _write_inventory,
> get_canonical_
>
> Cheers,
>
> Jelmer
It seems you are adding a lot more places than just that, but I'll admit
I'm not looking directly at the code.
John enigmail. mozdev. org/
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAk2 wfmgACgkQJdeBCY SNAAM9OACcDNX8E kG9F1GaXNk7WKdb fFd4 fW2padetzNpa2S+ TZ
MEIAoIqQVdNYc4q
=IAY7
-----END PGP SIGNATURE-----