Auto p4 login when possible.

Author:yangyingchao, 2013-03-27