Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 50852:13ad1b2ad3b4
branch: migrate `opts` to native kwargs
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 20 Aug 2023 00:55:52 -0400 |
parents | 489268c8ee7e |
children | 1270677d740b |
comparison
equal
deleted
inserted
replaced
50851:aad6e62d64f8 | 50852:13ad1b2ad3b4 |
---|---|
1005 return list(choice.values())[0] | 1005 return list(choice.values())[0] |
1006 | 1006 |
1007 raise error.UnknownCommand(cmd, allcmds) | 1007 raise error.UnknownCommand(cmd, allcmds) |
1008 | 1008 |
1009 | 1009 |
1010 def changebranch(ui, repo, revs, label, opts): | 1010 def changebranch(ui, repo, revs, label, **opts): |
1011 """Change the branch name of given revs to label""" | 1011 """Change the branch name of given revs to label""" |
1012 | 1012 |
1013 with repo.wlock(), repo.lock(), repo.transaction(b'branches'): | 1013 with repo.wlock(), repo.lock(), repo.transaction(b'branches'): |
1014 # abort in case of uncommitted merge or dirty wdir | 1014 # abort in case of uncommitted merge or dirty wdir |
1015 bailifchanged(repo) | 1015 bailifchanged(repo) |
1024 rewriteutil.precheck(repo, revs, b'change branch of') | 1024 rewriteutil.precheck(repo, revs, b'change branch of') |
1025 | 1025 |
1026 root = repo[roots.first()] | 1026 root = repo[roots.first()] |
1027 rpb = {parent.branch() for parent in root.parents()} | 1027 rpb = {parent.branch() for parent in root.parents()} |
1028 if ( | 1028 if ( |
1029 not opts.get(b'force') | 1029 not opts.get('force') |
1030 and label not in rpb | 1030 and label not in rpb |
1031 and label in repo.branchmap() | 1031 and label in repo.branchmap() |
1032 ): | 1032 ): |
1033 raise error.InputError( | 1033 raise error.InputError( |
1034 _(b"a branch of the same name already exists") | 1034 _(b"a branch of the same name already exists") |