# HG changeset patch # User Pierre-Yves David # Date 1687038451 -7200 # Node ID e9c676ad18f1ea6de15c37d3aaa570e03314495e # Parent c96fd53c0e2db9d3c3591e4c4ab3edf061fa9182 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. diff -r c96fd53c0e2d -r e9c676ad18f1 mercurial/commands.py --- a/mercurial/commands.py Thu Jun 15 09:51:29 2023 +0200 +++ b/mercurial/commands.py Sat Jun 17 23:47:31 2023 +0200 @@ -5214,11 +5214,6 @@ assert subopt not in (b'name', b'url') if showsubopts: fm.plain(b'%s:%s = ' % (name, subopt)) - if isinstance(value, bool): - if value: - value = b'yes' - else: - value = b'no' display = urlutil.path_suboptions_display[subopt] value = display(value) fm.condwrite(showsubopts, subopt, b'%s\n', value) diff -r c96fd53c0e2d -r e9c676ad18f1 mercurial/utils/urlutil.py --- 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: