how to browse shred repository for 'heads'?

Wouter van Heyst larstiq at larstiq.dyndns.org
Tue Jul 18 16:08:37 BST 2006


On Tue, Jul 18, 2006 at 05:45:25PM +0300, Alexander Belchenko wrote:
> Robert Collins пишет:
> ...
> >in the root of the repo:
> >$ python
> >
> >>>>import bzrlib.repository
> >>>>r = bzrlib.repository.Repository.open('.')
> >>>>g = r.get_revision_graph()
> >>>>possible_heads = set(g.keys())
> >>>>not_heads = set()
> >>>>for parents in g.values()
> >
> >....     not_heads.update(set(parents))
> >
> >
> >>>>heads = possible_heads.difference(not_heads)
> 
> Based on your code I make simple plugin 'heads' that prints for found 
> heads revision info.
> 
> http://bzr.onembedding.com/bzr.win/plugins/heads/

Thanks! I like for it to also work from a branch. I should have really
written tests, but there you go: http://bzr.richtlijn.be/heads

Wouter van Heyst




More information about the bazaar mailing list