mercurial/scmutil.py
changeset 46096 4d5e2fd53707
parent 46042 1bf2b44c4007
child 46115 be3d8178251e
equal deleted inserted replaced
46095:93e09d370003 46096:4d5e2fd53707
  2187         return b' '.join(short(h) for h in nodes)
  2187         return b' '.join(short(h) for h in nodes)
  2188     first = b' '.join(short(h) for h in nodes[:maxnumnodes])
  2188     first = b' '.join(short(h) for h in nodes[:maxnumnodes])
  2189     return _(b"%s and %d others") % (first, len(nodes) - maxnumnodes)
  2189     return _(b"%s and %d others") % (first, len(nodes) - maxnumnodes)
  2190 
  2190 
  2191 
  2191 
  2192 def enforcesinglehead(repo, tr, desc, accountclosed=False):
  2192 def enforcesinglehead(repo, tr, desc, accountclosed, filtername):
  2193     """check that no named branch has multiple heads"""
  2193     """check that no named branch has multiple heads"""
  2194     if desc in (b'strip', b'repair'):
  2194     if desc in (b'strip', b'repair'):
  2195         # skip the logic during strip
  2195         # skip the logic during strip
  2196         return
  2196         return
  2197     visible = repo.filtered(b'visible')
  2197     visible = repo.filtered(filtername)
  2198     # possible improvement: we could restrict the check to affected branch
  2198     # possible improvement: we could restrict the check to affected branch
  2199     bm = visible.branchmap()
  2199     bm = visible.branchmap()
  2200     for name in bm:
  2200     for name in bm:
  2201         heads = bm.branchheads(name, closed=accountclosed)
  2201         heads = bm.branchheads(name, closed=accountclosed)
  2202         if len(heads) > 1:
  2202         if len(heads) > 1: