comparison mercurial/debugcommands.py @ 50955:2a7dba8658a7

debugbundle: migrate `opts` to native kwargs This is a utility function that's only called by `debugbundle()`. The rest of the command was previously ported.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 21 Aug 2023 16:19:51 -0400
parents 18c8c18993f0
children ad9b7017ca22
comparison
equal deleted inserted replaced
50954:32c13716147e 50955:2a7dba8658a7
392 ui.write(b"%s%s\n" % (indent_string, hex(node))) 392 ui.write(b"%s%s\n" % (indent_string, hex(node)))
393 393
394 394
395 def _debugobsmarkers(ui, part, indent=0, **opts): 395 def _debugobsmarkers(ui, part, indent=0, **opts):
396 """display version and markers contained in 'data'""" 396 """display version and markers contained in 'data'"""
397 opts = pycompat.byteskwargs(opts)
398 data = part.read() 397 data = part.read()
399 indent_string = b' ' * indent 398 indent_string = b' ' * indent
400 try: 399 try:
401 version, markers = obsolete._readmarkers(data) 400 version, markers = obsolete._readmarkers(data)
402 except error.UnknownVersion as exc: 401 except error.UnknownVersion as exc:
405 ui.write(msg) 404 ui.write(msg)
406 else: 405 else:
407 msg = b"%sversion: %d (%d bytes)\n" 406 msg = b"%sversion: %d (%d bytes)\n"
408 msg %= indent_string, version, len(data) 407 msg %= indent_string, version, len(data)
409 ui.write(msg) 408 ui.write(msg)
410 fm = ui.formatter(b'debugobsolete', opts) 409 fm = ui.formatter(b'debugobsolete', pycompat.byteskwargs(opts))
411 for rawmarker in sorted(markers): 410 for rawmarker in sorted(markers):
412 m = obsutil.marker(None, rawmarker) 411 m = obsutil.marker(None, rawmarker)
413 fm.startitem() 412 fm.startitem()
414 fm.plain(indent_string) 413 fm.plain(indent_string)
415 cmdutil.showmarker(fm, m) 414 cmdutil.showmarker(fm, m)