Patchwork D7131: copies: simplify chain loop

login
register
mail settings
Submitter phabricator
Date Oct. 19, 2019, 5:38 p.m.
Message ID <20f20ce276605cb8010ed66518a76e27@localhost.localdomain>
Download mbox | patch
Permalink /patch/42508/
State Not Applicable
Headers show

Comments

phabricator - Oct. 19, 2019, 5:38 p.m.
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

Patch

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