Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 35196: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 | ee64e677c3cf |
children | bfd072c52e03 |
comparison
equal
deleted
inserted
replaced
35195:900ed9853017 | 35196:5cc14407a739 |
---|---|
3135 # old o - changeset to amend | 3135 # old o - changeset to amend |
3136 # | | 3136 # | |
3137 # base o - first parent of the changeset to amend | 3137 # base o - first parent of the changeset to amend |
3138 wctx = repo[None] | 3138 wctx = repo[None] |
3139 | 3139 |
3140 # Copy to avoid mutating input | |
3141 extra = extra.copy() | |
3140 # Update extra dict from amended commit (e.g. to preserve graft | 3142 # Update extra dict from amended commit (e.g. to preserve graft |
3141 # source) | 3143 # source) |
3142 extra.update(old.extra()) | 3144 extra.update(old.extra()) |
3143 | 3145 |
3144 # Also update it from the from the wctx | 3146 # Also update it from the from the wctx |