How to sweep servo using arduino and push buttons??

i need such a arduino code when 1 push putton is pressed servo's arm should sweep slowly untill the force is removed from push button.

it will help me making control of side mirror of my car

This is not a code writing service. What we do is to help you get code that you write to work the way that you want.

Some hints
Servo sweep example.
Button press test.
The if structure reference.

Read the how to use this forum sticky to see how to post code and some advice on how to get the most from the forum.

Post your best effort at writing the code and if it does not do what you want, describe what the code actually does and how that differs from what you want and we can try to help.