comparison mercurial/commands.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 9d4a2ea3dcb9
children 0ab3956540a6
comparison
equal deleted inserted replaced
50402:c96fd53c0e2d 50403:e9c676ad18f1
5212 fm.condwrite(not ui.quiet, b'url', b'%s\n', hidepassword(path.rawloc)) 5212 fm.condwrite(not ui.quiet, b'url', b'%s\n', hidepassword(path.rawloc))
5213 for subopt, value in sorted(path.suboptions.items()): 5213 for subopt, value in sorted(path.suboptions.items()):
5214 assert subopt not in (b'name', b'url') 5214 assert subopt not in (b'name', b'url')
5215 if showsubopts: 5215 if showsubopts:
5216 fm.plain(b'%s:%s = ' % (name, subopt)) 5216 fm.plain(b'%s:%s = ' % (name, subopt))
5217 if isinstance(value, bool):
5218 if value:
5219 value = b'yes'
5220 else:
5221 value = b'no'
5222 display = urlutil.path_suboptions_display[subopt] 5217 display = urlutil.path_suboptions_display[subopt]
5223 value = display(value) 5218 value = display(value)
5224 fm.condwrite(showsubopts, subopt, b'%s\n', value) 5219 fm.condwrite(showsubopts, subopt, b'%s\n', value)
5225 5220
5226 fm.end() 5221 fm.end()