Patchwork D10443: template: make an explicit closure for formatting entry in peerurls

login
register
mail settings
Submitter phabricator
Date April 16, 2021, 12:03 a.m.
Message ID <differential-rev-PHID-DREV-dasw5kdggsw7petvdcou-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48760/
State Superseded
Headers show

Comments

phabricator - April 16, 2021, 12:03 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is about to be become significantly more complicated as `ui.path[x]` will
  become a list.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10443

AFFECTED FILES
  mercurial/templatekw.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -673,7 +673,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'})