hgext3rd/topic/flow.py
changeset 3157 f286eefbd20d
child 3158 678a9802c56b
equal deleted inserted replaced
3156:31493a1b0e39 3157:f286eefbd20d
       
     1 from __future__ import absolute_import
       
     2 
       
     3 from mercurial import (
       
     4     error,
       
     5     node,
       
     6 )
       
     7 
       
     8 from mercurial.i18n import _
       
     9 
       
    10 def enforcesinglehead(repo, tr):
       
    11     for name, heads in repo.filtered('visible').branchmap().iteritems():
       
    12         if len(heads) > 1:
       
    13             hexs = [node.short(n) for n in heads]
       
    14             raise error.Abort(_('%d heads on "%s"') % (len(heads), name),
       
    15                               hint=(', '.join(hexs)))