Mercurial > hg
comparison mercurial/commands.py @ 50824:489268c8ee7e
cmdutil: migrate `opts` on commitstatus() to native kwargs
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 19 Aug 2023 23:06:40 -0400 |
parents | b922c767b214 |
children | 973fbb27ab45 |
comparison
equal
deleted
inserted
replaced
50823:b922c767b214 | 50824:489268c8ee7e |
---|---|
2173 # this behavior to remain. | 2173 # this behavior to remain. |
2174 if not obsolete.isenabled(repo, obsolete.createmarkersopt): | 2174 if not obsolete.isenabled(repo, obsolete.createmarkersopt): |
2175 cmdutil.checkunfinished(repo) | 2175 cmdutil.checkunfinished(repo) |
2176 | 2176 |
2177 node = cmdutil.amend(ui, repo, old, extra, pats, opts) | 2177 node = cmdutil.amend(ui, repo, old, extra, pats, opts) |
2178 opts = pycompat.byteskwargs(opts) | |
2179 if node == old.node(): | 2178 if node == old.node(): |
2180 ui.status(_(b"nothing changed\n")) | 2179 ui.status(_(b"nothing changed\n")) |
2181 return 1 | 2180 return 1 |
2182 else: | 2181 else: |
2183 | 2182 |
2204 match, | 2203 match, |
2205 editor=editor, | 2204 editor=editor, |
2206 extra=extra, | 2205 extra=extra, |
2207 ) | 2206 ) |
2208 | 2207 |
2209 opts = pycompat.byteskwargs(opts) | 2208 node = cmdutil.commit( |
2210 node = cmdutil.commit(ui, repo, commitfunc, pats, opts) | 2209 ui, repo, commitfunc, pats, pycompat.byteskwargs(opts) |
2210 ) | |
2211 | 2211 |
2212 if not node: | 2212 if not node: |
2213 stat = cmdutil.postcommitstatus(repo, pats, opts) | 2213 stat = cmdutil.postcommitstatus( |
2214 repo, pats, pycompat.byteskwargs(opts) | |
2215 ) | |
2214 if stat.deleted: | 2216 if stat.deleted: |
2215 ui.status( | 2217 ui.status( |
2216 _( | 2218 _( |
2217 b"nothing changed (%d missing files, see " | 2219 b"nothing changed (%d missing files, see " |
2218 b"'hg status')\n" | 2220 b"'hg status')\n" |
2221 ) | 2223 ) |
2222 else: | 2224 else: |
2223 ui.status(_(b"nothing changed\n")) | 2225 ui.status(_(b"nothing changed\n")) |
2224 return 1 | 2226 return 1 |
2225 | 2227 |
2226 cmdutil.commitstatus(repo, node, branch, bheads, tip, opts) | 2228 cmdutil.commitstatus(repo, node, branch, bheads, tip, **opts) |
2227 | 2229 |
2228 if not ui.quiet and ui.configbool(b'commands', b'commit.post-status'): | 2230 if not ui.quiet and ui.configbool(b'commands', b'commit.post-status'): |
2229 status( | 2231 status( |
2230 ui, | 2232 ui, |
2231 repo, | 2233 repo, |
2232 modified=True, | 2234 modified=True, |
2233 added=True, | 2235 added=True, |
2234 removed=True, | 2236 removed=True, |
2235 deleted=True, | 2237 deleted=True, |
2236 unknown=True, | 2238 unknown=True, |
2237 subrepos=opts.get(b'subrepos'), | 2239 subrepos=opts.get('subrepos'), |
2238 ) | 2240 ) |
2239 | 2241 |
2240 | 2242 |
2241 @command( | 2243 @command( |
2242 b'config|showconfig|debugconfig', | 2244 b'config|showconfig|debugconfig', |