def upstream_revs(filt, repo, subset, x):
    upstream_tips = [node.hex(n) for name, n in
             repo._remotebranches.iteritems() if filt(name)]
    if not upstream_tips: []

    if smartset is not None:
        # 4.2 codepath
        return repo.revs('::%ln', map(node.bin, upstream_tips))
    if getattr(revset, 'baseset', False):
        # 3.5 codepath
        return revset.baseset(
            repo.revs('::%ln', map(node.bin, upstream_tips)))
    ls = getattr(revset, 'lazyset', False)
    if ls:
        # If revset.lazyset exists (hg 3.0), use lazysets instead for
        # speed.
        tipancestors = repo.revs('::%ln', map(node.bin, upstream_tips))
        def cond(n):
            return n in tipancestors
        return ls(subset, cond)
    # 2.9 and earlier codepath
    upstream = reduce(lambda x, y: x.update(y) or x,
                      map(lambda x: set(revset.ancestors(repo, subset, x)),
                          [('string', n) for n in upstream_tips]),
                      set())
    return [r for r in subset if r in upstream]
Exemple #2
0
def upstream_revs(filt, repo, subset, x):
    upstream_tips = [node.hex(n) for name, n in
             repo._remotebranches.iteritems() if filt(name)]
    if not upstream_tips: []

    if smartset is not None:
        # 4.2 codepath
        return repo.revs('::%ln', map(node.bin, upstream_tips))
    if getattr(revset, 'baseset', False):
        # 3.5 codepath
        return revset.baseset(
            repo.revs('::%ln', map(node.bin, upstream_tips)))
    ls = getattr(revset, 'lazyset', False)
    if ls:
        # If revset.lazyset exists (hg 3.0), use lazysets instead for
        # speed.
        tipancestors = repo.revs('::%ln', map(node.bin, upstream_tips))
        def cond(n):
            return n in tipancestors
        return ls(subset, cond)
    # 2.9 and earlier codepath
    upstream = reduce(lambda x, y: x.update(y) or x,
                      map(lambda x: set(revset.ancestors(repo, subset, x)),
                          [('string', n) for n in upstream_tips]),
                      set())
    return [r for r in subset if r in upstream]
def upstream_revs(filt, repo, subset, x):
    nodes = [node.hex(n) for name, n in
             repo._remotebranches.iteritems() if filt(name)]
    if not nodes: []
    upstream = reduce(lambda x, y: x.update(y) or x,
                      map(lambda x: set(revset.ancestors(repo, subset, x)),
                          [('string', n) for n in nodes]),
                      set())
    return [r for r in subset if r in upstream]
Exemple #4
0
def upstream_revs(filt, repo, subset, x):
    nodes = [
        node.hex(n) for name, n in repo._remotebranches.iteritems()
        if filt(name)
    ]
    if not nodes: []
    upstream = reduce(
        lambda x, y: x.update(y) or x,
        map(lambda x: set(revset.ancestors(repo, subset, x)),
            [('string', n) for n in nodes]), set())
    return [r for r in subset if r in upstream]