how to browse shred repository for 'heads'?

Alexander Belchenko bialix at ukr.net
Tue Jul 18 15:45:25 BST 2006


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/

--
Alexander





More information about the bazaar mailing list