upgrade: directly use the upgrade action constant
This make the code simpler and will make it simpler to add more case in the
future.
Differential Revision: https://phab.mercurial-scm.org/D9467
public attribute not declared in interfaces: badpeer.badattributepublic attribute not declared in interfaces: badpeer.badmethod