[PATCH 2 of 5] copies: show we can read data from the "first" mapping

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Dec 2 06:28:17 EST 2019


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1573674334 -3600
#      Wed Nov 13 20:45:34 2019 +0100
# Node ID 2671000fb23f978fbacb56cd168d4a5f529c0b59
# Parent  79af3064c0b820d4339e595eb89d40e930eeadfd
# EXP-Topic patch-copies-rust-prep
# Available At https://dev.heptapod.net/octobus/mercurial-devel/
#              hg pull https://dev.heptapod.net/octobus/mercurial-devel/ -r 2671000fb23f
copies: show we can read data from the "first" mapping

In practice this make no difference since `t` is a copy of `a`. Having this
change before hand will make the next cleanup changeset clearer.

This is work on the road to using some native code for some performance critical
part of copy tracing.

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -67,7 +67,7 @@ def _chain(a, b):
     """chain two sets of copies 'a' and 'b'"""
     t = a.copy()
     for k, v in pycompat.iteritems(b):
-        t[k] = t.get(v, v)
+        t[k] = a.get(v, v)
     return t
 
 


More information about the Mercurial-devel mailing list