template: make an explicit closure for formatting entry in peerurls
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 15 Apr 2021 12:08:34 +0200
changeset 47033 824ee4aaa09b
parent 47032 6ce1af5f0764
child 47034 0d8ff1f4ab0c
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
mercurial/templatekw.py
--- a/mercurial/templatekw.py	Thu Apr 15 11:50:08 2021 +0200
+++ b/mercurial/templatekw.py	Thu Apr 15 12:08:34 2021 +0200
@@ -672,7 +672,10 @@
         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'})