Extract last_known_revision logic to Deployment class