From patchwork Sat Oct 19 17:38:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7131: copies: simplify chain loop From: phabricator X-Patchwork-Id: 42508 Message-Id: <20f20ce276605cb8010ed66518a76e27@localhost.localdomain> To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sat, 19 Oct 2019 17:38:30 +0000 Closed by commit rHGf0a2c1972e81: copies: simplify chain loop (authored by marmoute). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7131?vs=17333&id=17363 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7131/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7131 AFFECTED FILES mercurial/copies.py CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -67,10 +67,7 @@ """chain two sets of copies 'a' and 'b'""" t = a.copy() for k, v in pycompat.iteritems(b): - if v in t: - t[k] = t[v] - else: - t[k] = v + t[k] = t.get(v, v) return t