D7131: copies: simplify chain loop

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Sat Oct 19 13:38:30 EDT 2019


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

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
 
 



To: marmoute, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list