##// END OF EJS Templates
cmdutil: migrate `opts` on commitstatus() to native kwargs
Matt Harbison -
r51717:489268c8 default
parent child Browse files
Show More
@@ -3329,9 +3329,7 b' def buildcommittext(repo, ctx, subs, ext'
3329 return b"\n".join(edittext)
3329 return b"\n".join(edittext)
3330
3330
3331
3331
3332 def commitstatus(repo, node, branch, bheads=None, tip=None, opts=None):
3332 def commitstatus(repo, node, branch, bheads=None, tip=None, **opts):
3333 if opts is None:
3334 opts = {}
3335 ctx = repo[node]
3333 ctx = repo[node]
3336 parents = ctx.parents()
3334 parents = ctx.parents()
3337
3335
@@ -3341,7 +3339,7 b' def commitstatus(repo, node, branch, bhe'
3341 # for most instances
3339 # for most instances
3342 repo.ui.warn(_(b"warning: commit already existed in the repository!\n"))
3340 repo.ui.warn(_(b"warning: commit already existed in the repository!\n"))
3343 elif (
3341 elif (
3344 not opts.get(b'amend')
3342 not opts.get('amend')
3345 and bheads
3343 and bheads
3346 and node not in bheads
3344 and node not in bheads
3347 and not any(
3345 and not any(
@@ -3378,7 +3376,7 b' def commitstatus(repo, node, branch, bhe'
3378 #
3376 #
3379 # H H n head merge: head count decreases
3377 # H H n head merge: head count decreases
3380
3378
3381 if not opts.get(b'close_branch'):
3379 if not opts.get('close_branch'):
3382 for r in parents:
3380 for r in parents:
3383 if r.closesbranch() and r.branch() == branch:
3381 if r.closesbranch() and r.branch() == branch:
3384 repo.ui.status(
3382 repo.ui.status(
@@ -2175,7 +2175,6 b' def _docommit(ui, repo, *pats, **opts):'
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
@@ -2206,11 +2205,14 b' def _docommit(ui, repo, *pats, **opts):'
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 _(
@@ -2223,7 +2225,7 b' def _docommit(ui, repo, *pats, **opts):'
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(
@@ -2234,7 +2236,7 b' def _docommit(ui, repo, *pats, **opts):'
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
General Comments 0
You need to be logged in to leave comments. Login now