예제 #1
0
파일: __init__.py 프로젝트: quark-zju/eden
def backedup(repo, subset, x):
    """draft changesets that have been backed up to Commit Cloud"""
    unfi = repo
    state = backupstate.BackupState(repo, ccutil.getremotepath(repo, None))
    backedup = unfi.revs("not public() and ::%ln", state.heads)
    return smartset.filteredset(subset & repo.revs("draft()"),
                                lambda r: r in backedup)
예제 #2
0
def notbackedup(repo, subset, x):
    """changesets that have not yet been backed up to Commit Cloud"""
    unfi = repo.unfiltered()
    state = backupstate.BackupState(repo, ccutil.getremotepath(repo, None))
    backedup = unfi.revs("not public() and ::%ln", state.heads)
    return smartset.filteredset(subset & repo.revs("not public() - hidden()"),
                                lambda r: r not in backedup)
예제 #3
0
def backedup(repo, subset, x):
    """draft changesets that have been backed up to Commit Cloud"""
    unfi = repo
    heads = backupstate.BackupState.readheadsfromallpaths(repo)
    cl = repo.changelog
    if cl.algorithmbackend == "segments":
        backedup = repo.dageval(lambda: draft() & ancestors(heads))
        return subset & cl.torevset(backedup)
    backedup = unfi.revs("not public() and ::%ln", heads)
    return smartset.filteredset(subset & repo.revs("draft()"), lambda r: r in backedup)
예제 #4
0
def notbackedup(repo, subset, x):
    """changesets that have not yet been backed up to Commit Cloud"""
    unfi = repo
    heads = backupstate.BackupState(repo, ccutil.getremotepath(repo.ui)).heads
    cl = repo.changelog
    if cl.algorithmbackend == "segments":
        notbackedup = repo.dageval(lambda: draft() - ancestors(heads))
        return subset & cl.torevset(notbackedup)
    backedup = unfi.revs("not public() and ::%ln", heads)
    return smartset.filteredset(subset & repo.revs("not public() - hidden()"),
                                lambda r: r not in backedup)
예제 #5
0
파일: __init__.py 프로젝트: simpkins/eden
def backedup(repo, subset, x):
    """draft changesets that have been backed up to Commit Cloud"""
    path = ccutil.getnullableremotepath(repo.ui)
    if not path:
        return smartset.baseset(repo=repo)
    heads = backupstate.BackupState(repo, path).heads
    cl = repo.changelog
    if cl.algorithmbackend == "segments":
        backedup = repo.dageval(lambda: draft() & ancestors(heads))
        return subset & cl.torevset(backedup)
    backedup = repo.revs("not public() and ::%ln", heads)
    return smartset.filteredset(subset & repo.revs("draft()"), lambda r: r in backedup)
예제 #6
0
def upstream_revs(filt, repo, subset, x):
    upstream_tips = set()
    for remotename in repo._remotenames.keys():
        rname = "remote" + remotename
        try:
            ns = repo.names[rname]
        except KeyError:
            continue
        for name in ns.listnames(repo):
            if filt(splitremotename(name)[0]):
                upstream_tips.update(ns.nodes(repo, name))

    if not upstream_tips:
        return smartset.baseset([], repo=repo)

    tipancestors = repo.revs("::%ln", upstream_tips)
    return smartset.filteredset(subset, lambda n: n in tipancestors)
예제 #7
0
파일: __init__.py 프로젝트: simpkins/eden
def notbackedup(repo, subset, x):
    """changesets that have not yet been backed up to Commit Cloud"""
    path = ccutil.getnullableremotepath(repo.ui)
    if not path:
        # arguably this should return draft(). However, since there is no
        # remote, and no way to do backup, returning an empty set avoids
        # upsetting users with "not backed up" warnings.
        return smartset.baseset(repo=repo)
    heads = backupstate.BackupState(repo, path).heads
    cl = repo.changelog
    if cl.algorithmbackend == "segments":
        notbackedup = repo.dageval(lambda: draft() - ancestors(heads))
        return subset & cl.torevset(notbackedup)
    backedup = repo.revs("not public() and ::%ln", heads)
    return smartset.filteredset(
        subset & repo.revs("not public() - hidden()"), lambda r: r not in backedup
    )