amend: make a copy of "extra" to avoid mutating an input
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 01 Dec 2017 14:13:55 -0800
changeset 35196 5cc14407a739
parent 35195 900ed9853017
child 35197 bfd072c52e03
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
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Sat Dec 02 06:32:41 2017 +0530
+++ b/mercurial/cmdutil.py	Fri Dec 01 14:13:55 2017 -0800
@@ -3137,6 +3137,8 @@
         # 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())