[MERGE] Graph.heads()

John Arbash Meinel john at arbash-meinel.com
Wed Aug 15 16:03:45 BST 2007


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

Robert Collins wrote:
> On Wed, 2007-08-15 at 00:42 -0400, Martin Pool wrote:
>> Martin Pool has voted approve.
>> Status is now: Approved
>> Comment:
>> You could call it get_graph_object maybe.
>>
>> But perhaps rather than being on the VersionedFile it should be on the 
>> Repository, since vf seems to expose a bit too much of the repo 
>> implementation.
> 
> In this case I think the usage of heads in determining the file id
> last-changed should be on repository, so it's an internal issue to
> repository.
> 
> Having it on VF would not be bad, though inside a pack repo we'd
> probably avoid the extra mapping layers involved.
> 
> Also nice would be a move to ask for many file ids to be resolved at
> once - to work in a more set like manner, so that we can do a single
> index pass - think about the impact of multi-bisect.
> 
> -Rob
> 
> 

Well, for a first implementation, I think I'll go with:

Graph = Repository.get_file_graph(file_id)

For further implementation, we probably could do something like:

for file_id, heads in Repository.iter_heads([(file_id, [revision_ids]),
					     (fid2, [revid1, revid2])]):

There is a bit of tension, in that you don't really want to do all file
ids for the whole tree at one go, but it might be reasonable to do
something like this per directory. I was also thinking to have it
special case when there is only 1 passed in head, since we know right
away that it can be the only one.

John
=:->

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

iD8DBQFGwxXRJdeBCYSNAAMRAilkAKClIWOcS1xeb3Pr7Onvj0YqLODTqACeNFc3
jdLLnYujF91JyMDfuRC5biE=
=Yye4
-----END PGP SIGNATURE-----



More information about the bazaar mailing list