mercurial/scmutil.py
changeset 42969 76608f9f27f6
parent 42926 34ed651ba7e4
child 43076 2372284d9457
--- a/mercurial/scmutil.py	Wed Sep 25 12:57:11 2019 +0200
+++ b/mercurial/scmutil.py	Wed Sep 25 12:59:26 2019 +0200
@@ -1895,14 +1895,16 @@
     first = ' '.join(short(h) for h in nodes[:maxnumnodes])
     return _("%s and %d others") % (first, len(nodes) - maxnumnodes)
 
-def enforcesinglehead(repo, tr, desc):
+def enforcesinglehead(repo, tr, desc, accountclosed=False):
     """check that no named branch has multiple heads"""
     if desc in ('strip', 'repair'):
         # skip the logic during strip
         return
     visible = repo.filtered('visible')
     # possible improvement: we could restrict the check to affected branch
-    for name, heads in visible.branchmap().iteritems():
+    bm = visible.branchmap()
+    for name in bm:
+        heads = bm.branchheads(name, closed=accountclosed)
         if len(heads) > 1:
             msg = _('rejecting multiple heads on branch "%s"')
             msg %= name