changeset 35207:5cc14407a739

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
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 01 Dec 2017 14:13:55 -0800
parents 900ed9853017
children bfd072c52e03
files mercurial/cmdutil.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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())