예제 #1
0
파일: mirror.py 프로젝트: bhdn/repsys
def autoswitch(svn, wcpath, wcurl, newbaseurl=None):
    """Switches between mirror, default_parent, or newbaseurl"""
    nobase = False
    mirror = mirror_url()
    repository = layout.repository_url()
    current = repository
    if repository is None:
        raise Error, "the option repository from repsys.conf is "\
                "required"
    indefault = same_base(repository, wcurl)
    if not newbaseurl:
        if not mirror:
            raise Error, "an URL is needed when the option mirror "\
                    "from repsys.conf is not set"
        if indefault:
            chosen = mirror
        elif same_base(mirror, wcurl):
            current = mirror
            chosen = repository
        else:
            nobase = True
    else:
        if mirror and same_base(mirror, wcurl):
            current = mirror
        elif indefault:
            pass # !!!!
        else:
            nobase = True
        chosen = newbaseurl
    if nobase:
        raise Error, "the URL of this working copy is not based in "\
                "repository nor mirror URLs"
    assert current != chosen
    newurl = mirror_relocate(current, chosen, wcurl, wcpath)
    return newurl
예제 #2
0
def autoswitch(svn, wcpath, wcurl, newbaseurl=None):
    """Switches between mirror, default_parent, or newbaseurl"""
    nobase = False
    mirror = mirror_url()
    repository = layout.repository_url()
    current = repository
    if repository is None:
        raise Error, "the option repository from repsys.conf is "\
                "required"
    indefault = same_base(repository, wcurl)
    if not newbaseurl:
        if not mirror:
            raise Error, "an URL is needed when the option mirror "\
                    "from repsys.conf is not set"
        if indefault:
            chosen = mirror
        elif same_base(mirror, wcurl):
            current = mirror
            chosen = repository
        else:
            nobase = True
    else:
        if mirror and same_base(mirror, wcurl):
            current = mirror
        elif indefault:
            pass  # !!!!
        else:
            nobase = True
        chosen = newbaseurl
    if nobase:
        raise Error, "the URL of this working copy is not based in "\
                "repository nor mirror URLs"
    assert current != chosen
    newurl = mirror_relocate(current, chosen, wcurl, wcpath)
    return newurl
예제 #3
0
def enabled(wcurl=None):
    mirror = mirror_url()
    repository = layout.repository_url()
    enabled = False
    if mirror and repository:
        enabled = True
        if wcurl and not same_base(mirror, wcurl):
            enabled = False
    return enabled
예제 #4
0
파일: mirror.py 프로젝트: bhdn/repsys
def enabled(wcurl=None):
    mirror = mirror_url()
    repository = layout.repository_url()
    enabled = False
    if mirror and repository:
        enabled = True
        if wcurl and not same_base(mirror, wcurl):
            enabled = False
    return enabled
예제 #5
0
def switchto_parent_url(url):
    newurl = relocate_path(mirror_url(), layout.repository_url(), url)
    return newurl
예제 #6
0
def switchto_parent(svn, url, path):
    """Relocates the working copy to default_parent"""
    newurl = mirror_relocate(mirror_url(), layout.repository_url(), url, path)
    return newurl
예제 #7
0
def switchto_mirror(svn, url, path):
    newurl = mirror_relocate(layout.repository_url(), mirror_url(), url, path)
    return newurl
예제 #8
0
파일: mirror.py 프로젝트: bhdn/repsys
def switchto_mirror(svn, url, path):
    newurl = mirror_relocate(layout.repository_url(), mirror_url(), url, path)
    return newurl
예제 #9
0
파일: mirror.py 프로젝트: bhdn/repsys
def switchto_parent_url(url):
    newurl = relocate_path(mirror_url(), layout.repository_url(), url)
    return newurl
예제 #10
0
파일: mirror.py 프로젝트: bhdn/repsys
def switchto_parent(svn, url, path):
    """Relocates the working copy to default_parent"""
    newurl = mirror_relocate(mirror_url(), layout.repository_url(), url, path)
    return newurl