changeset 5711:570023086a36 stable

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.
author Martin von Zweigbergk <martinvonz@google.com>
date Sun, 13 Dec 2020 09:46:16 -0800
parents f65b2a978a1e
children e2a2c392aaed
files hgext3rd/evolve/headchecking.py
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/headchecking.py	Tue Dec 08 11:58:34 2020 +0800
+++ b/hgext3rd/evolve/headchecking.py	Sun Dec 13 09:46:16 2020 -0800
@@ -164,13 +164,17 @@
     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