##// END OF EJS Templates
gpg: migrate `opts` to native kwargs
Matt Harbison -
r51770:b3ac579b default
parent child Browse files
Show More
@@ -301,13 +301,13 b' def sign(ui, repo, *revs, **opts):'
301 301
302 302 def _dosign(ui, repo, *revs, **opts):
303 303 mygpg = newgpg(ui, **opts)
304 opts = pycompat.byteskwargs(opts)
304
305 305 sigver = b"0"
306 306 sigmessage = b""
307 307
308 date = opts.get(b'date')
308 date = opts.get('date')
309 309 if date:
310 opts[b'date'] = dateutil.parsedate(date)
310 opts['date'] = dateutil.parsedate(date)
311 311
312 312 if revs:
313 313 nodes = [repo.lookup(n) for n in revs]
@@ -335,13 +335,13 b' def _dosign(ui, repo, *revs, **opts):'
335 335 sigmessage += b"%s %s %s\n" % (hexnode, sigver, sig)
336 336
337 337 # write it
338 if opts[b'local']:
338 if opts['local']:
339 339 repo.vfs.append(b"localsigs", sigmessage)
340 340 return
341 341
342 342 msigs = match.exact([b'.hgsigs'])
343 343
344 if not opts[b"force"]:
344 if not opts["force"]:
345 345 if any(repo.status(match=msigs, unknown=True, ignored=True)):
346 346 raise error.Abort(
347 347 _(b"working copy of .hgsigs is changed "),
@@ -356,21 +356,19 b' def _dosign(ui, repo, *revs, **opts):'
356 356 with repo.dirstate.changing_files(repo):
357 357 repo[None].add([b".hgsigs"])
358 358
359 if opts[b"no_commit"]:
359 if opts["no_commit"]:
360 360 return
361 361
362 message = opts[b'message']
362 message = opts['message']
363 363 if not message:
364 364 # we don't translate commit messages
365 365 message = b"\n".join(
366 366 [b"Added signature for changeset %s" % short(n) for n in nodes]
367 367 )
368 368 try:
369 editor = cmdutil.getcommiteditor(
370 editform=b'gpg.sign', **pycompat.strkwargs(opts)
371 )
369 editor = cmdutil.getcommiteditor(editform=b'gpg.sign', **opts)
372 370 repo.commit(
373 message, opts[b'user'], opts[b'date'], match=msigs, editor=editor
371 message, opts['user'], opts['date'], match=msigs, editor=editor
374 372 )
375 373 except ValueError as inst:
376 374 raise error.Abort(pycompat.bytestr(inst))
General Comments 0
You need to be logged in to leave comments. Login now