In terms of passing on climbs, if someone is chugging along I'll wait for a good/appropriate spot to pass just so I don't feck up somebody else's groove.
Ahh who am I kidding, they don't call me elbows for nothing.
Really though, it's about respect for the guy in front of you. I don't care who you are or what you're riding, don't put someone else out. The only exception I'd make is if I can see someone struggling and there is an obviously harder section a little ahead where it's pretty clear they're not going to clean it and I feel pretty confident that I have my mojo going enough that I will clean it. In that case I'd call rider up before I pass. I think the key thing is leaving enough of a gap till you decide to pass so that you can assess what's going on and figure out if you'll be able to make the pass or just settle in a few (3-4) bike lengths behind the rider in front of you and maybe take just a little bit longer on the current section until there's a good opportunity to pass. The advantage to leaving some space is that if they do inadvertently mess up you've got some time to correct your line and they have a bit of time to get out of the way as you (hopefully) make a clean pass.