Mercurial > public > mercurial-scm > hg
comparison mercurial/debugcommands.py @ 50965:e6ae6573b400
debugsidedata: migrate `opts` to native kwargs
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 21 Aug 2023 17:43:52 -0400 |
parents | 36f116820853 |
children | b28f794fe10a |
comparison
equal
deleted
inserted
replaced
50964:36f116820853 | 50965:e6ae6573b400 |
---|---|
3549 @command(b'debugsidedata', cmdutil.debugrevlogopts, _(b'-c|-m|FILE REV')) | 3549 @command(b'debugsidedata', cmdutil.debugrevlogopts, _(b'-c|-m|FILE REV')) |
3550 def debugsidedata(ui, repo, file_, rev=None, **opts): | 3550 def debugsidedata(ui, repo, file_, rev=None, **opts): |
3551 """dump the side data for a cl/manifest/file revision | 3551 """dump the side data for a cl/manifest/file revision |
3552 | 3552 |
3553 Use --verbose to dump the sidedata content.""" | 3553 Use --verbose to dump the sidedata content.""" |
3554 opts = pycompat.byteskwargs(opts) | 3554 if opts.get('changelog') or opts.get('manifest') or opts.get('dir'): |
3555 if opts.get(b'changelog') or opts.get(b'manifest') or opts.get(b'dir'): | |
3556 if rev is not None: | 3555 if rev is not None: |
3557 raise error.InputError( | 3556 raise error.InputError( |
3558 _(b'cannot specify a revision with other arguments') | 3557 _(b'cannot specify a revision with other arguments') |
3559 ) | 3558 ) |
3560 file_, rev = None, file_ | 3559 file_, rev = None, file_ |
3561 elif rev is None: | 3560 elif rev is None: |
3562 raise error.InputError(_(b'please specify a revision')) | 3561 raise error.InputError(_(b'please specify a revision')) |
3563 r = cmdutil.openstorage(repo, b'debugdata', file_, opts) | 3562 r = cmdutil.openstorage( |
3563 repo, b'debugdata', file_, pycompat.byteskwargs(opts) | |
3564 ) | |
3564 r = getattr(r, '_revlog', r) | 3565 r = getattr(r, '_revlog', r) |
3565 try: | 3566 try: |
3566 sidedata = r.sidedata(r.lookup(rev)) | 3567 sidedata = r.sidedata(r.lookup(rev)) |
3567 except KeyError: | 3568 except KeyError: |
3568 raise error.Abort(_(b'invalid revision identifier %s') % rev) | 3569 raise error.Abort(_(b'invalid revision identifier %s') % rev) |