示例#1
0
def _gethiddenblockers(repo):
    """Get revisions that will block hidden changesets from being filtered

    This is a standalone function to help extensions to wrap it."""
    assert not repo.changelog.filteredrevs
    hideable = hideablerevs(repo)
    blockers = []
    if hideable:
        # We use cl to avoid recursive lookup from repo[xxx]
        cl = repo.changelog
        firsthideable = min(hideable)
        revs = cl.revs(start=firsthideable)
        tofilter = repo.revs('(%ld) and children(%ld)', list(revs),
                             list(hideable))
        blockers = [r for r in tofilter if r not in hideable]
        for par in repo[None].parents():
            blockers.append(par.rev())
        for bm in repo._bookmarks.values():
            blockers.append(cl.rev(bm))
        tags = {}
        tagsmod.readlocaltags(repo.ui, repo, tags, {})
        if tags:
            rev, nodemap = cl.rev, cl.nodemap
            blockers.extend(
                rev(t[0]) for t in tags.values() if t[0] in nodemap)
    return blockers
示例#2
0
def _getdynamicblockers(repo):
    """Non-cacheable revisions blocking hidden changesets from being filtered.

    Get revisions that will block hidden changesets and are likely to change,
    but unlikely to create hidden blockers. They won't be cached, so be careful
    with adding additional computation."""

    cl = repo.changelog
    blockers = set()
    blockers.update([par.rev() for par in repo[None].parents()])
    blockers.update([cl.rev(bm) for bm in repo._bookmarks.values()])

    tags = {}
    tagsmod.readlocaltags(repo.ui, repo, tags, {})
    if tags:
        rev, nodemap = cl.rev, cl.nodemap
        blockers.update(rev(t[0]) for t in tags.values() if t[0] in nodemap)
    return blockers
示例#3
0
def _getdynamicblockers(repo):
    """Non-cacheable revisions blocking hidden changesets from being filtered.

    Get revisions that will block hidden changesets and are likely to change,
    but unlikely to create hidden blockers. They won't be cached, so be careful
    with adding additional computation."""

    cl = repo.changelog
    blockers = set()
    blockers.update([par.rev() for par in repo[None].parents()])
    blockers.update([cl.rev(bm) for bm in repo._bookmarks.values()])

    tags = {}
    tagsmod.readlocaltags(repo.ui, repo, tags, {})
    if tags:
        rev, nodemap = cl.rev, cl.nodemap
        blockers.update(rev(t[0]) for t in tags.values() if t[0] in nodemap)
    return blockers
示例#4
0
def _gethiddenblockers(repo):
    """Get revisions that will block hidden changesets from being filtered

    This is a standalone function to help extensions to wrap it."""
    assert not repo.changelog.filteredrevs
    hideable = hideablerevs(repo)
    blockers = []
    if hideable:
        # We use cl to avoid recursive lookup from repo[xxx]
        cl = repo.changelog
        firsthideable = min(hideable)
        revs = cl.revs(start=firsthideable)
        tofilter = repo.revs(
            '(%ld) and children(%ld)', list(revs), list(hideable))
        blockers = [r for r in tofilter if r not in hideable]
        for par in repo[None].parents():
            blockers.append(par.rev())
        for bm in repo._bookmarks.values():
            blockers.append(cl.rev(bm))
        tags = {}
        tagsmod.readlocaltags(repo.ui, repo, tags, {})
        if tags:
            blockers.extend(cl.rev(t[0]) for t in tags.values())
    return blockers