mirror of
https://github.com/facebook/sapling.git
synced 2024-10-13 02:07:31 +03:00
b858cf6123
Summary: arc lint --apply-patches --take BLACK *.py Reviewed By: ryanmce Differential Revision: D8183174 fbshipit-source-id: d96ce6c476e283d7d97c84ceae95a576bdf3ea8a
22 lines
650 B
Python
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)
|