Comment 1 for bug 434079

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 434079] [NEW] need an in-branch-p predicate for revision ids

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

Samuel Bronson wrote:
> Public bug reported:
>
> Bzr-search needs an efficient way to check if a given revision-id is
> part of a specific branch or not in order to use a shared index for a
> shared repository, according to bug #358286. Probably it is a good idea
> to add this?
>
> ** Affects: bzr
> Importance: Undecided
> Status: New
>

Well, there is:

  revno = branch.revision_id_to_dotted_revno(revision_id)

If that fails the revision_id is not in the ancestry of the branch.

It is slightly less optimal, because we do more than the minimum work to
find it. For example, we could 'stop early' if we find the revision,
before we finish reading the whole ancestry.

However, the work done is cached, so calling that 20 times should end up
being cheap for all but the first call.

John
=:->

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

iEYEARECAAYFAkq3opMACgkQJdeBCYSNAAMI1gCgmqKUyIPC3bSw2L/dg7jIq4+W
RjwAoKsL5Lk1jd4Z9NQmjiyu1PO1myyr
=ZY1z
-----END PGP SIGNATURE-----