This new function mirror the python code. This first implementation does a lot
of data copies and is therefore quite slow. However my goal here is to create a
simple "frame" from where to start adding optimization.
This patch focus on the hg-core part of this work. Coming patches will do the
necessary hg-cpython work to be able to use this from Python.
Could be worth documenting which of the key or value are source v.s. destination. At first I assumed the opposite of what the code seems to be doing.
Speaking of, can multiple keys have the same value? If so, what does that represent?