Introduce generator for lefthand branch history

Aaron Bentley aaron at aaronbentley.com
Fri Nov 27 15:43:49 GMT 2009


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

Martin von Gagern wrote:
> The closest thing to a linear history which bzr provides is the
> lefthand history. It is currently accessible by the
> bzrlib.branch.Branch._lefthand_history method, which generates a list,
> starting with the oldest real revision and ending with the argument
> revision.
> 
> I propose that you make that function public and official.

We already have a public, official method for getting the lefthand
revision history of a branch: Branch.revision_history.

> Therefore you
> could turn the function into a generator, yielding revisions of lefthand
> ancestors starting at the argument and ending at the initial commit.

We have this already, in the form of
Repository.iter_reverse_revision_history.

> It would also be nice to have a linear view of the future of an
> arbitrary revision

A given revision may have many descendants, and they are unordered--
there's no such thing as a left-hand descendant.  You need to specify
how you would choose which descendants to follow before we can discuss
this sensibly.

There will probably be serious performance consequences, because bzr is
not built to walk forwards in a performant way, and there are no indices
of parent -> child relationships.

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

iEYEARECAAYFAksP87IACgkQ0F+nu1YWqI34IwCfW5QC68WgA/Sl+ZNlsXFdeE5J
aLQAnj3qOWFbyRMSUYo/svH9AEXC3BlQ
=8BCI
-----END PGP SIGNATURE-----



More information about the bazaar mailing list