comparison hgext/amend.py @ 47428:54849b65dc5f

cmdutil: make checknotesize() work on str-keyed opts Since this patch changes the behavior of the function, I consider it a bonus if the signature also changes so that extensions can detect which version they're dealing with (for the record, I don't have any such extensions). Therefore, I also dropped an unused `ui` argument and renamed the function to use snake_case. Differential Revision: https://phab.mercurial-scm.org/D10859
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 10 Jun 2021 14:25:16 -0700
parents 6ce89165eaa0
children 6000f5b25c9b
comparison
equal deleted inserted replaced
47427:6ce89165eaa0 47428:54849b65dc5f
14 14
15 from mercurial.i18n import _ 15 from mercurial.i18n import _
16 from mercurial import ( 16 from mercurial import (
17 cmdutil, 17 cmdutil,
18 commands, 18 commands,
19 pycompat,
20 registrar, 19 registrar,
21 ) 20 )
22 21
23 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for 22 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
24 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should 23 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
64 Similar to :hg:`commit --amend`, but reuse the commit message without 63 Similar to :hg:`commit --amend`, but reuse the commit message without
65 invoking editor, unless ``--edit`` was set. 64 invoking editor, unless ``--edit`` was set.
66 65
67 See :hg:`help commit` for more details. 66 See :hg:`help commit` for more details.
68 """ 67 """
69 cmdutil.checknotesize(ui, pycompat.byteskwargs(opts)) 68 cmdutil.check_note_size(opts)
70 69
71 with repo.wlock(), repo.lock(): 70 with repo.wlock(), repo.lock():
72 if not opts.get('logfile'): 71 if not opts.get('logfile'):
73 opts['message'] = opts.get('message') or repo[b'.'].description() 72 opts['message'] = opts.get('message') or repo[b'.'].description()
74 opts['amend'] = True 73 opts['amend'] = True