def ancestorset(self, starts, stops=None):
    rlog = self._revlog
    idx = rlog.index
    stops = ((stops and set(stops)) or set())
    seen = set()
    pending = list(starts)
    while pending:
        rev = pending.pop()
        if ((rev not in seen) and (rev not in stops)):
            seen.add(rev)
            revdata = idx[rev]
            for i in [5, 6]:
                prev = revdata[i]
                if (prev != nullrev):
                    pending.append(prev)
    return seen
def ancestorset(self, starts, stops=None):
    rlog = self._revlog
    idx = rlog.index
    stops = ((stops and set(stops)) or set())
    seen = set()
    pending = list(starts)
    while pending:
        rev = pending.pop()
        if ((rev not in seen) and (rev not in stops)):
            seen.add(rev)
            revdata = idx[rev]
            for i in [5, 6]:
                prev = revdata[i]
                if (prev != nullrev):
                    pending.append(prev)
    return seen