# HG changeset patch # User Pierre-Yves David # Date 2021-04-15 10:08:34 # Node ID d63c01a3179d82f274068b300083fe6585192a4f # Parent 74891f524559180b9ac803b0b78f2ffe4b52c002 template: make an explicit closure for formatting entry in peerurls This is about to be become significantly more complicated as `ui.path[x]` will become a list. Differential Revision: https://phab.mercurial-scm.org/D10443 diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -672,7 +672,10 @@ def showpeerurls(context, mapping): d.update((o, v) for o, v in sorted(pycompat.iteritems(p.suboptions))) return d - return _hybrid(None, urls, makemap, lambda k: b'%s=%s' % (k, urls[k])) + def format_one(k): + return b'%s=%s' % (k, urls[k]) + + return _hybrid(None, urls, makemap, format_one) @templatekeyword(b"predecessors", requires={b'repo', b'ctx'})