hgext/amend.py
changeset 34889 554885e10868
parent 34795 530b7361e3a9
child 34970 3e549546a6e9
equal deleted inserted replaced
34888:317566f0c2e6 34889:554885e10868
    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     error,
    19     registrar,
    20     registrar,
    20 )
    21 )
    21 
    22 
    22 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
    23 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
    23 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
    24 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
    43     Similar to :hg:`commit --amend`, but reuse the commit message without
    44     Similar to :hg:`commit --amend`, but reuse the commit message without
    44     invoking editor, unless ``--edit`` was set.
    45     invoking editor, unless ``--edit`` was set.
    45 
    46 
    46     See :hg:`help commit` for more details.
    47     See :hg:`help commit` for more details.
    47     """
    48     """
       
    49     if len(opts['note']) > 255:
       
    50         raise error.Abort(_("cannot store a note of more than 255 bytes"))
    48     with repo.wlock(), repo.lock():
    51     with repo.wlock(), repo.lock():
    49         if not opts.get('logfile'):
    52         if not opts.get('logfile'):
    50             opts['message'] = opts.get('message') or repo['.'].description()
    53             opts['message'] = opts.get('message') or repo['.'].description()
    51         opts['amend'] = True
    54         opts['amend'] = True
    52         return commands._docommit(ui, repo, *pats, **opts)
    55         return commands._docommit(ui, repo, *pats, **opts)