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

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 2, 2019, 11:28 a.m.
Message ID <2671000fb23f978fbacb.1575286097@nodosa.octobus.net>
Download mbox | patch
Permalink /patch/43556/
State Accepted
Headers show

Comments

Pierre-Yves David - Dec. 2, 2019, 11:28 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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