sapling/hgext/commitcloud/service.py
Liubov Dmitrieva b858cf6123 codemod: join the auto-formatter party for commitcloud and intinitepush
Summary: arc lint --apply-patches --take BLACK *.py

Reviewed By: ryanmce

Differential Revision: D8183174

fbshipit-source-id: d96ce6c476e283d7d97c84ceae95a576bdf3ea8a
2018-05-29 11:20:56 -07:00

22 lines
650 B
Python

# Copyright 2018 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
from mercurial import error
from . import httpsservice, localservice
def get(ui, token=None):
servicetype = ui.config("commitcloud", "servicetype")
if servicetype == "local":
return localservice.LocalService(ui)
elif servicetype == "remote":
return httpsservice.HttpsCommitCloudService(ui, token)
else:
msg = "Unrecognized commitcloud.servicetype: %s" % servicetype
raise error.Abort(msg)