[MERGE] lookup revno by iterating history

Aaron Bentley aaron at aaronbentley.com
Tue Mar 18 01:25:32 GMT 2008


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

John Arbash Meinel wrote:
> Aaron Bentley wrote:
>> I realize that you're just updating an
>> existing function, but can you try to unify them?

> I can try, but looking at it _lefthand_history() wants to re-use the
> Graph object so it can check "is_ancestor". And I really don't want to
> be grabbing 2 Graph objects unless we have the KnitPackRepository
> sharing its CachingParentsProvider with all graph callers.

Yeah, I don't think we should do that.

It's not actually necessary to keep the Graph around, though.  The
is_ancestor check is optional behavior, so we could simply move the
_lefthand_history code onto repository, turn it into a generator, and
implement iter_reverse_revision_history on top.

> I suppose I could also allow passing in a Graph object to re-use, but as
> it is a public Repository function, that starts breaking things for bzr-svn.

What about putting the actual implementation on Graph?  That seems like
a reasonably good place for it, and there are no independent Graph
implementations, so we wouldn't be making life hard for bzr-svn or anything.

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

iD8DBQFH3xoM0F+nu1YWqI0RAjUcAJ99m/jmxIVfFpJ6sRUF3TXVVuS5MwCght1w
jE5dLG7dGiU++4TYYo6q37M=
=oLcm
-----END PGP SIGNATURE-----



More information about the bazaar mailing list