# HG changeset patch # User Martin von Zweigbergk # Date 2017-12-01 22:13:55 # Node ID 5cc14407a739ff54739e55907760306c9a9418fe # Parent 900ed9853017c5f56665f6c900f16e8514e77c92 amend: make a copy of "extra" to avoid mutating an input I don't know of any problems this has caused, it just seems less surprising. Differential Revision: https://phab.mercurial-scm.org/D1575 diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -3137,6 +3137,8 @@ def amend(ui, repo, old, extra, pats, op # base o - first parent of the changeset to amend wctx = repo[None] + # Copy to avoid mutating input + extra = extra.copy() # Update extra dict from amended commit (e.g. to preserve graft # source) extra.update(old.extra())