How do I rotate an edge but leave scale out of it?

I am creating ceiling molding for a house, at the corner or edges of a wall the molding edge must be turned in a 45 degree angle. when I try to rotate the edge 45 degress on the Z axis it move the Y postion of the vertices also, I would like the vertices to stay in there Y position but just rotate (or slide) to the new 45 degree angle. I guess they would just be sliding along the X axis. Is there a way to do this?

In the pictures below the vertices are manually slid on the X axis to form the 45 degree angle, but that is very time consuming, in the last picture it shows what happens with a normal Z axis rotation. The vertices move away from there original Y location.

Use the Shear tool. Note the options on the 3d view header to select the shear axis when you use this tool

Alternatively just use the knife tool (K) to make a new cut at the desired angle

Nice just what I needed!