Mercurial > hg
comparison mercurial/copies.py @ 32640: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 | 5313d98089f5 |
children | 42ad7cc645a4 |
comparison
equal
deleted
inserted
replaced
32639:c2fe2b00db53 | 32640:aeac3cbcbbc1 |
---|---|
417 _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, data1) | 417 _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, data1) |
418 | 418 |
419 for f in u2u: | 419 for f in u2u: |
420 _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, data2) | 420 _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, data2) |
421 | 421 |
422 copy = dict(data1['copy'].items() + data2['copy'].items()) | 422 copy = dict(data1['copy']) |
423 fullcopy = dict(data1['fullcopy'].items() + data2['fullcopy'].items()) | 423 copy.update(data2['copy']) |
424 fullcopy = dict(data1['fullcopy']) | |
425 fullcopy.update(data2['fullcopy']) | |
424 | 426 |
425 if dirtyc1: | 427 if dirtyc1: |
426 _combinecopies(data2['incomplete'], data1['incomplete'], copy, diverge, | 428 _combinecopies(data2['incomplete'], data1['incomplete'], copy, diverge, |
427 incompletediverge) | 429 incompletediverge) |
428 else: | 430 else: |