I have seen 3 different “tricks” for soldering when the problem is a small amount of water coming down the pipe, besides the “bread dam trick.”

1. Use a “self tapping-self sealing” 1/8 or 1/4 fitting on the bottom of the existing water pipe to drain off water downstream of where the repair needs to be. These are the special fittings used to connect water to an ice maker or furnace humidifier, and often contain their own small shut off valve. They are available to clamp on various diameter large pipes.

2. Find the lowest faucet after turning off the (worn & leaking) main water cut off valve, tape a wet dry vacuum hose to that lowest discharge point, and turn on the wet dry vac long enough to suck the water and moist air away from your spot while you complete the soldering.

3. Create a “high spot” if you have enough room to the left and right of where you are making the repair.
Get two 22.5 degree solder elbows and one 45 degree elbow.
Make up before hand a section of repair pipe with one 22.5 degree, a length of pipe, a 45 elbow, length of pipe, then 22.5 elbow to “get back to level.”
Lift the water line upward temporarily on the side where the leaking valve is to create a “high spot” free of water for several minutes.
Solder on your 22.5/45/22.5 section beginning with the 22.5 elbow facing up. Let the water pipe drop back down to original level.
This obviously involves more soldering and elbows but “buys dry time” for that first critical soldering joint that would otherwise be ruined by the dripping water.
Many times you can do this with only two 22.5 elbows.
If you have a tube or conduit bender you can do similar starting with straight copper pipe and two bends much less than 22.5 degrees.