The concept of upgrading units is very simple at first glance but, in some cases, it can be quite messy.
Let’s look first at a very simple example. Effect 211 upgrades Militia into Man at arms, specifically the first command, the others are not relevant at this point. Following the Militia line, effect 182 upgrades into Two-handed swordsman. The first command upgrades Militia and the second one the Man at arms.
Now, one could ask, why do we need two commands? If in order to research Two-handed swordsman, one has to research Man at arms, by the time you get to the second tech, all Militias are already Man at arms.
Turns out that the game works the opposite way: all the Men at arms you are about to upgrade are still Millitias for the game. If the upgrade to Two-handed swordsman only had the command for Men at arms, yours wouldn’t be affected.
This doesn’t mean either that Men at arms upgraded from Militias are different from newly created ones once the upgrade is researched. The upgrade from Militia to Man at arms affects both current and future Men at arms. When you create a Man at arms in the Barrack