Mercurial > hg > mercurial-source
changeset 33423:aeac3cbcbbc1
py3: use dict.update() instead of constructing lists and adding them
dict.items() returned a list on Python 2 and whereas on Python 3 it returns a
view object. So we required a work around. Using dict.update() is better then
constructing lists as it should save us on gc churns.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Thu, 01 Jun 2017 01:14:02 +0530 |
parents | c2fe2b00db53 |
children | 49e1e5acb8ff |
files | mercurial/copies.py |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -419,8 +419,10 @@ for f in u2u: _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, data2) - copy = dict(data1['copy'].items() + data2['copy'].items()) - fullcopy = dict(data1['fullcopy'].items() + data2['fullcopy'].items()) + copy = dict(data1['copy']) + copy.update(data2['copy']) + fullcopy = dict(data1['fullcopy']) + fullcopy.update(data2['fullcopy']) if dirtyc1: _combinecopies(data2['incomplete'], data1['incomplete'], copy, diverge,