comparison mercurial/commands.py @ 49582:3adca6eb6659 stable

commit: properly consider file include and exclude options when closing branch It looks like this is meant to prevent adding another commit that does nothing but close a branch on top of a commit that already closed the branch. The matcher building functions want `Dict[bytes, Any]`, not `Dict[str, Any]`, which was found by adding type hints to the matcher related methods in scmutil.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 18 Nov 2022 13:43:03 -0500
parents f2b1bc19ce90
children bc59c1e5dd01 c9690836747d
comparison
equal deleted inserted replaced
49581:7ddbb3623a07 49582:3adca6eb6659
2112 extra[b'close'] = b'1' 2112 extra[b'close'] = b'1'
2113 2113
2114 if repo[b'.'].closesbranch(): 2114 if repo[b'.'].closesbranch():
2115 # Not ideal, but let us do an extra status early to prevent early 2115 # Not ideal, but let us do an extra status early to prevent early
2116 # bail out. 2116 # bail out.
2117 matcher = scmutil.match(repo[None], pats, opts) 2117 matcher = scmutil.match(
2118 repo[None], pats, pycompat.byteskwargs(opts)
2119 )
2118 s = repo.status(match=matcher) 2120 s = repo.status(match=matcher)
2119 if s.modified or s.added or s.removed: 2121 if s.modified or s.added or s.removed:
2120 bheads = repo.branchheads(branch, closed=True) 2122 bheads = repo.branchheads(branch, closed=True)
2121 else: 2123 else:
2122 msg = _(b'current revision is already a branch closing head') 2124 msg = _(b'current revision is already a branch closing head')