[MERGE] Graph.find_revno()

Aaron Bentley aaron at aaronbentley.com
Thu May 22 07:43:42 BST 2008


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

John Arbash Meinel wrote:
> This adds a new API to Graph. The idea is to make it easier to determine
> a real
> 'revno' when all we have is limited information.

I'm not sure that this is generally useful.  We usually want to get a
revno in the context of a branch, where many revisions don't have
integer revnos.

> Right now, we have some special cases where we check something like:
> ~  if rev_id == branch.last_revision():
> ~    revno = branch.revno()
> ~  else:
> ~    revno = len(branch.repository.iter_history(rev_id))

Are we actually doing this a lot?  Calculating a revno without the
context of a branch?  I can see maybe doing it in the *implementation*
of a branch, but it looks like The Wrong Thing for every other situation.

We already have pretty efficient way of calculating the revno for a
revision_id in the context of a branch: Branch6.revision_id_to_revno,
which I implemented a couple months ago.  Is it unsuitable for the cases
you're looking at?

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

iD8DBQFINRYd0F+nu1YWqI0RAn0TAJ9UX99dmOlZ3dxcWda6opx2+xE4zQCfW6wb
Q5eT6NJP7ZZp1lh335bn6kw=
=14H8
-----END PGP SIGNATURE-----



More information about the bazaar mailing list