# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1508061723 -19800 # Node ID 5781e0931c163a9a5892424a5867cc6f24497a7d # Parent 3df59451cdec29663fefa1b8d999721fbded7f4f cmdutil: pass metadata from amend() to cleanupnodes `commit --amend` and amend command in core and extensions rely on cmdutil.amend() for amending a commit. So the logic to add a note to amend must reside here. This patch assumes that note will be passed in opts dictionary to the function and it will be passed to cleanupnodes and then createmarkers to store the note in the obsmarker metadata. After this patch, note can be stored on an amend changeset by passing notes as a part of opts to cmdutil.amend(). Differential Revision: https://phab.mercurial-scm.org/D1094 diff -r 3df59451cdec -r 5781e0931c16 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sun Oct 15 14:34:24 2017 +0530 +++ b/mercurial/cmdutil.py Sun Oct 15 15:32:03 2017 +0530 @@ -3152,7 +3152,10 @@ # Reroute the working copy parent to the new changeset repo.setparents(newid, nullid) mapping = {old.node(): (newid,)} - scmutil.cleanupnodes(repo, mapping, 'amend') + obsmetadata = None + if opts.get('note'): + obsmetadata = {'note': opts['note']} + scmutil.cleanupnodes(repo, mapping, 'amend', metadata=obsmetadata) # Fixing the dirstate because localrepo.commitctx does not update # it. This is rather convenient because we did not need to update