##// END OF EJS Templates
changegroupsubset: simplify parents pruning
Benoit Boissinot -
r10010:2fce9691 default
parent child Browse files
Show More
@@ -1707,18 +1707,8 b' class localrepository(repo.repository):'
1707 # also assume the recipient will have all the parents. This function
1707 # also assume the recipient will have all the parents. This function
1708 # prunes them from the set of missing nodes.
1708 # prunes them from the set of missing nodes.
1709 def prune_parents(revlog, hasset, msngset):
1709 def prune_parents(revlog, hasset, msngset):
1710 haslst = list(hasset)
1710 for r in revlog.ancestors(*[revlog.rev(n) for n in hasset]):
1711 haslst.sort(key=revlog.rev)
1711 msngset.pop(revlog.node(r), None)
1712 for node in haslst:
1713 parentlst = [p for p in revlog.parents(node) if p != nullid]
1714 while parentlst:
1715 n = parentlst.pop()
1716 if n not in hasset:
1717 hasset.add(n)
1718 p = [p for p in revlog.parents(n) if p != nullid]
1719 parentlst.extend(p)
1720 for n in hasset:
1721 msngset.pop(n, None)
1722
1712
1723 # This is a function generating function used to set up an environment
1713 # This is a function generating function used to set up an environment
1724 # for the inner function to execute in.
1714 # for the inner function to execute in.
General Comments 0
You need to be logged in to leave comments. Login now