# HG changeset patch # User Matt Harbison # Date 1692566198 14400 # Node ID b5066b2b40f2a234eee030a65c1752c8c1e249c7 # Parent 9ed17632ad8366ae52426dbaf82faf702e48d7e0 split: migrate `opts` to native kwargs diff -r 9ed17632ad83 -r b5066b2b40f2 hgext/split.py --- a/hgext/split.py Sun Aug 20 17:09:33 2023 -0400 +++ b/hgext/split.py Sun Aug 20 17:16:38 2023 -0400 @@ -22,7 +22,6 @@ error, hg, logcmdutil, - pycompat, registrar, revsetlang, rewriteutil, @@ -65,10 +64,9 @@ By default, rebase connected non-obsoleted descendants onto the new changeset. Use --no-rebase to avoid the rebase. """ - opts = pycompat.byteskwargs(opts) revlist = [] - if opts.get(b'rev'): - revlist.append(opts.get(b'rev')) + if opts.get('rev'): + revlist.append(opts.get('rev')) revlist.extend(revs) with repo.wlock(), repo.lock(): tr = repo.transaction(b'split') @@ -89,7 +87,7 @@ if ctx.node() is None: raise error.InputError(_(b'cannot split working directory')) - if opts.get(b'rebase'): + if opts.get('rebase'): # Skip obsoleted descendants and their descendants so the rebase # won't cause conflicts for sure. descendants = list(repo.revs(b'(%d::) - (%d)', rev, rev)) @@ -116,7 +114,7 @@ wnode = repo[b'.'].node() top = None try: - top = dosplit(ui, repo, tr, ctx, opts) + top = dosplit(ui, repo, tr, ctx, **opts) finally: # top is None: split failed, need update --clean recovery. # wnode == ctx.node(): wnode split, no need to update. @@ -128,7 +126,7 @@ dorebase(ui, repo, torebase, top) -def dosplit(ui, repo, tr, ctx, opts): +def dosplit(ui, repo, tr, ctx, **opts): committed = [] # [ctx] # Set working parent to ctx.p1(), and keep working copy as ctx's content @@ -166,13 +164,13 @@ ) % short(ctx.node()) opts.update( { - b'edit': True, - b'interactive': True, - b'message': header + ctx.description(), + 'edit': True, + 'interactive': True, + 'message': header + ctx.description(), } ) origctx = repo[b'.'] - commands.commit(ui, repo, **pycompat.strkwargs(opts)) + commands.commit(ui, repo, **opts) newctx = repo[b'.'] # Ensure user didn't do a "no-op" split (such as deselecting # everything).