コード例 #1
0
ファイル: edenapi.py プロジェクト: xmonader/eden
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)
コード例 #2
0
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)
コード例 #3
0
def getclient(ui):
    """Obtain the edenapi client"""
    correlator = ui.correlator()
    return edenapi.client(ui._rcfg._rcfg, correlator)