comparison mercurial/debugcommands.py @ 50952:45381a1dd367

debugformat: migrate `opts` to native kwargs
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 21 Aug 2023 17:14:18 -0400
parents 44c29568898f
children 7825175d5ad5
comparison
equal deleted inserted replaced
50951:44c29568898f 50952:45381a1dd367
1707 def debugformat(ui, repo, **opts): 1707 def debugformat(ui, repo, **opts):
1708 """display format information about the current repository 1708 """display format information about the current repository
1709 1709
1710 Use --verbose to get extra information about current config value and 1710 Use --verbose to get extra information about current config value and
1711 Mercurial default.""" 1711 Mercurial default."""
1712 opts = pycompat.byteskwargs(opts)
1713 maxvariantlength = max(len(fv.name) for fv in upgrade.allformatvariant) 1712 maxvariantlength = max(len(fv.name) for fv in upgrade.allformatvariant)
1714 maxvariantlength = max(len(b'format-variant'), maxvariantlength) 1713 maxvariantlength = max(len(b'format-variant'), maxvariantlength)
1715 1714
1716 def makeformatname(name): 1715 def makeformatname(name):
1717 return b'%s:' + (b' ' * (maxvariantlength - len(name))) 1716 return b'%s:' + (b' ' * (maxvariantlength - len(name)))
1718 1717
1719 fm = ui.formatter(b'debugformat', opts) 1718 fm = ui.formatter(b'debugformat', pycompat.byteskwargs(opts))
1720 if fm.isplain(): 1719 if fm.isplain():
1721 1720
1722 def formatvalue(value): 1721 def formatvalue(value):
1723 if hasattr(value, 'startswith'): 1722 if hasattr(value, 'startswith'):
1724 return value 1723 return value