Patchwork D1575: amend: make a copy of "extra" to avoid mutating an input

login
register
mail settings
Submitter phabricator
Date Dec. 2, 2017, 3:12 a.m.
Message ID <59ac884d8e841768d5262e2cd650c951@localhost.localdomain>
Download mbox | patch
Permalink /patch/25886/
State Not Applicable
Headers show

Comments

phabricator - Dec. 2, 2017, 3:12 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5cc14407a739: amend: make a copy of &quot;extra&quot; to avoid mutating an input (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1575?vs=4065&id=4079

REVISION DETAIL
  https://phab.mercurial-scm.org/D1575

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, yuja
Cc: mercurial-devel

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -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())