diff mercurial/utils/urlutil.py @ 50403:e9c676ad18f1 stable

path: use the next `display` argument to deal with boolean We have a generic mechanism that we can now use for the special case now.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 17 Jun 2023 23:47:31 +0200
parents c96fd53c0e2d
children 0ab3956540a6
line wrap: on
line diff
--- a/mercurial/utils/urlutil.py	Thu Jun 15 09:51:29 2023 +0200
+++ b/mercurial/utils/urlutil.py	Sat Jun 17 23:47:31 2023 +0200
@@ -688,6 +688,11 @@
     return register
 
 
+def display_bool(value):
+    """display a boolean suboption back to the user"""
+    return b'yes' if value else b'no'
+
+
 @pathsuboption(b'pushurl', b'_pushloc')
 def pushurlpathoption(ui, path, value):
     u = url(value)
@@ -768,7 +773,7 @@
     return DELTA_REUSE_POLICIES.get(value)
 
 
-@pathsuboption(b'multi-urls', b'multi_urls')
+@pathsuboption(b'multi-urls', b'multi_urls', display=display_bool)
 def multiurls_pathoption(ui, path, value):
     res = stringutil.parsebool(value)
     if res is None: