Push fails if creates more than 4 multiple heads on a given branch/topic combination
This crash was reported to me (traceback from py-heptapod)
2021-03-09_17:29:21.87263 File "/opt/gitlab/embedded/lib/python3.8/site-packages/hgext3rd/heptapod/state_maintainer.py", line 182, in extract_current_gitlab_branches
2021-03-09_17:29:21.87264 self.branchmap_entry_process_finalize(
2021-03-09_17:29:21.87264 File "/opt/gitlab/embedded/lib/python3.8/site-packages/hgext3rd/heptapod/state_maintainer.py", line 355, in branchmap_entry_process_finalize
2021-03-09_17:29:21.87265 scmutil.nodesummaries(repo, hg_shas))
2021-03-09_17:29:21.87265 File "/opt/gitlab/embedded/lib/python3.8/site-packages/mercurial/scmutil.py", line 2162, in nodesummaries
2021-03-09_17:29:21.87267 first = b' '.join(short(h) for h in nodes[:maxnumnodes])
2021-03-09_17:29:21.87268 TypeError: 'set' object is not subscriptable
The call to nodesummaries()
is the one that gives the hint in case of (prohibited) server-side multiple heads.
It turns out that nodesummaries
can work with sets only if they don't exceed the maximum size:
2159 def nodesummaries(repo, nodes, maxnumnodes=4):
2160 if len(nodes) <= maxnumnodes or repo.ui.verbose:
2161 return b' '.join(short(h) for h in nodes)
2162 first = b' '.join(short(h) for h in nodes[:maxnumnodes])
2163 return _(b"%s and %d others") % (first, len(nodes) - maxnumnodes)
2164