def _initclient(ui, repo): """Initialize a new Eden API client using the user's config.""" url = _getbaseurl(ui) kwargs = { "url": url, "repo": repo.name, "creds": _getcreds(ui, url), "databatchsize": ui.configint("edenapi", "databatchsize"), "historybatchsize": ui.configint("edenapi", "historybatchsize"), "validate": ui.configbool("edenapi", "validate"), "streamdata": ui.configbool("edenapi", "streamdata"), "streamhistory": ui.configbool("edenapi", "streamhistory"), "streamtrees": ui.configbool("edenapi", "streamtrees"), } return edenapi.client(**kwargs)
def setupclient(ui, repo): if not isinstance(repo, localrepo.localrepository): return # Even clients get the server setup since they need to have the # wireprotocol endpoints registered. remotefilelogserver.onetimesetup(ui) onetimeclientsetup(ui) repo.prepushoutgoinghooks.add("remotefilelog", prepush) shallowrepo.wraprepo(repo) repo.store = shallowstore.wrapstore(repo.store) repo.edenapi = None if ui.config("edenapi", "url"): repo.edenapi = edenapi.client(ui._rcfg._rcfg)
def getclient(ui): """Obtain the edenapi client""" correlator = ui.correlator() return edenapi.client(ui._rcfg._rcfg, correlator)