diff hgext3rd/topic/topicmap.py @ 6547:d13cfd9eb6c0

topic: compatibility for commitstatus(..., **opts) In 489268c8ee7e cmdutil.commitstatus() was changed to take opts as separate keyword arguments. We need to convert the byteskwargs to strings to use with double-star operator, so in the appropriate function wrapper we also now have strings instead of bytes in the opts dict.
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 30 Aug 2023 15:08:35 -0300
parents 0baef8dde96b
children 5efde4e19eb7 3635782b0290
line wrap: on
line diff
--- a/hgext3rd/topic/topicmap.py	Sun Aug 13 16:08:26 2023 -0300
+++ b/hgext3rd/topic/topicmap.py	Wed Aug 30 15:08:35 2023 -0300
@@ -97,7 +97,7 @@
     other = repo.filtered(topicfilter(repo.filtername))
     return orig(self, other, *args, **kwargs)
 
-def commitstatus(orig, repo, node, branch, bheads=None, tip=None, opts=None):
+def commitstatus(orig, repo, node, branch, bheads=None, tip=None, **opts):
     # wrap commit status use the topic branch heads
     ctx = repo[node]
     ctxbranch = common.formatfqbn(branch=ctx.branch())
@@ -105,16 +105,14 @@
         bheads = repo.branchheads(b"%s:%s" % (branch, ctx.topic()))
 
     with discovery.override_context_branch(repo) as repo:
-        ret = orig(repo, node, branch, bheads=bheads, tip=tip, opts=opts)
+        ret = orig(repo, node, branch, bheads=bheads, tip=tip, **opts)
 
     # logic copy-pasted from cmdutil.commitstatus()
-    if opts is None:
-        opts = {}
     if ctx.topic():
         return ret
     parents = ctx.parents()
 
-    if (not opts.get(b'amend') and bheads and node not in bheads and not any(
+    if (not opts.get('amend') and bheads and node not in bheads and not any(
         p.node() in bheads and common.formatfqbn(branch=p.branch()) == branch
         for p in parents
     )):