For fuel lines, I will use a tube-cutter to remove the damaged section, and use a flare tool to create some lips. If the section is small, perhaps a few inches, I'll just replace it with rubber fuel line and small stainless steel T-bolt clamps. That shouldn't cost more than $30 I think.
If the section is long, then I would follow much the same procedure; however, I'd match up new metal tubing to take up as much of the gap as I could. This would be for damaged sections ranging over foot or so. I'd look for a good way to secure the line as well - many times, if another line is in good shape, you can just use a hand-full of thick zip-tips. It works well! I'll create lips at the ends of the new pipe and the pieces of old pipe as well, then again use rubber fuel grade hose as the union.
The biggest concern is to NEVER ever use an angle grinder, saw or other device which can cause sparks. Tubbing cutters are very cheap ($10 or less for a nice one) and safe to use, and every hardware store carries them.
For Hydraulic lines, I use an angle grinder with a thin blade to cut the bad piece of tubing off. After the cut, I'll try to smoothen out the cut as much as possible. Make sure you have a GOOD flaring tool. The rental tool from autozone works well if you are careful with it. I am sort of hesitant to offer this advice, because it's not difficult to make a pin-hole leak which could lead to brake failure. If you are slow and careful though, it's easy to avoid damaging the line and easy to make a smooth flare for the union.
Make sure that you get brake unions that have a nipple on the inside of them, so that the new flare of the brake line is mated on the inside of the union and sealed very tight. If you cut the old brake lines to a length that is common for brake lines, then you can save your self half of the cutting and flaring trouble. I think that they come typically in 9" increments. It might be 6" though. Don't get European bubble flairs, get the same style as stock. This will make mating much easier!
A lot of the unions at Autozone are not designed well IMHO, but you can find a good one if you look for it. Murrays and Napa keep the best ones in stock. Brakes, much like the fuel system, is something you never skimp out on and try to $cut corners$.