What determines the weapon a spy disguise uses?
Solution 1:
Does the spy disguise copy the player at that exact moment
Yes.
You can still switch to one of your weapons and press B to switch your disguise weapon to the corresponding weapon slot. For example, holding out your sapper and pressing that key equips the disguise's secondary weapon.
Your disguise health also matches whatever health the enemy you're disguised as has at the moment you wear it (but your real health remains the same). If the disguise is low on health, you can try to trick an enemy Medic into healing you, so that both your fake and real health will go up.
Solution 2:
From my understanding, as soon as you use your disguise kit, the game searches for a member of the enemy team to disguise as, biased towards players of the class you have disguised as. If no member of the enemy team is playing a class you are disguised as, you will be assigned an enemy at random.
At this point, you will inherit the current disguised health total and equipped items of your target. By default, the disguise will equip whatever primary weapon the target has equipped. For instance, this means that when you disguise as a medic, you will get the needle gun (or non-standard item) the target has in their primary weapon slot.
After the disguise is engaged, you can switch which slot of the target you are disguising as by pressing b (when not disguised, this is the "Use last disguise" hotkey) , changing to whichever slot you have in use at the time (melee for knife, primary for revolver, secondary for sapper).
To the best of my knowledge, it is impossible to disguise with equipment your target does not have in their loadout.
I do not know if a random disguise (when there are no players of the class you are indicating) will use the target players loadout despite them not playing that class.