Read about our upcoming Code of Conduct on this issue

Commit 586f9ca8 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

compat: handle change to enforcesinglehead() signature

4d5e2fd53707 (singlehead: introduce option to restrict to public
changes, 2020-12-05) added a new argument (`filtername`) to the
signature. This patch makes us compatible with that.
parent a26d4726454f
Pipeline #14689 passed with stage
in 4 minutes and 45 seconds
......@@ -164,13 +164,17 @@ def _filter_obsolete_heads(repo, heads):
new_heads.sort()
return new_heads
def enforcesinglehead(orig, repo, tr, desc, accountclosed=False):
"""check that no named branch has multiple heads"""
def enforcesinglehead(orig, repo, tr, desc, accountclosed, filtername=b'visible'):
"""check that no named branch has multiple heads
COMPAT: this is the same as the upstream version as of c701f616d852, except
for the _filter_obsolete_heads call.
"""
nodesummaries = scmutil.nodesummaries
if desc in (b'strip', b'repair'):
# skip the logic during strip
return
visible = repo.filtered(b'visible')
visible = repo.filtered(filtername)
# possible improvement: we could restrict the check to affected branch
bm = visible.branchmap()
cl = repo.changelog
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment