changeset 44089:f0a2c1972e81

copies: simplify chain loop This is a mostly gratuitous change to make the code more direct. Differential Revision: https://phab.mercurial-scm.org/D7131
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 17 Oct 2019 16:06:06 +0200
parents 90213d027154
children 26caf96a5fa9
files mercurial/copies.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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