# HG changeset patch # User Benoit Boissinot # Date 1259944979 -3600 # Node ID 2fce96916d974c4db0764ab8db93bf6875126482 # Parent 69dca8574a6a9ed1cbc2589596ce5992bf03d26c changegroupsubset: simplify parents pruning diff -r 69dca8574a6a -r 2fce96916d97 mercurial/localrepo.py --- a/mercurial/localrepo.py Fri Dec 04 15:36:13 2009 +0100 +++ b/mercurial/localrepo.py Fri Dec 04 17:42:59 2009 +0100 @@ -1707,18 +1707,8 @@ # also assume the recipient will have all the parents. This function # prunes them from the set of missing nodes. def prune_parents(revlog, hasset, msngset): - haslst = list(hasset) - haslst.sort(key=revlog.rev) - for node in haslst: - parentlst = [p for p in revlog.parents(node) if p != nullid] - while parentlst: - n = parentlst.pop() - if n not in hasset: - hasset.add(n) - p = [p for p in revlog.parents(n) if p != nullid] - parentlst.extend(p) - for n in hasset: - msngset.pop(n, None) + for r in revlog.ancestors(*[revlog.rev(n) for n in hasset]): + msngset.pop(revlog.node(r), None) # This is a function generating function used to set up an environment # for the inner function to execute in.