how to browse shred repository for 'heads'?

Alexander Belchenko bialix at ukr.net
Tue Jul 18 15:39:54 BST 2006


Robert Collins пишет:
> On Tue, 2006-07-18 at 15:31 +0300, Alexander Belchenko wrote:
> 
>>I want to ask this question many times but actually don't ask before.
>>Today I do very bad mistake and break my work.
>>
>>If I have shared repository how I can browse all revisions inside it, 
>>revsions that does not have childs? IIRC, Mercurial have command 'hg 
>>heads' that prints all such revisions in similar situation. Is bzr does 
>>not have this interface?
> 
> 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)
> 
> 
> should do it for you (untested)

Thank you very much. It's indeed works for me.
I restore my branch.
Thank you again.

--
Alexander





More information about the bazaar mailing list