changeset 13708:ce9b3043b79d

changegroupsubset: simplify prune Ancestors of nodes linked to commonrevs can be expected to be linked to commonrevs. Walking graphs of each revlog looking for rare/nonexistent outliers is overkill.
author Matt Mackall <mpm@selenic.com>
date Sun, 20 Mar 2011 19:43:28 -0500
parents 296e78744d32
children 53826e7a1d22
files mercurial/localrepo.py
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sun Mar 20 19:43:28 2011 -0500
+++ b/mercurial/localrepo.py	Sun Mar 20 19:43:28 2011 -0500
@@ -1508,18 +1508,13 @@
         # also assume the recipient will have all the parents.  This function
         # prunes them from the set of missing nodes.
         def prune(revlog, missingnodes):
-            hasset = set()
-            # If a 'missing' filenode thinks it belongs to a changenode we
-            # assume the recipient must have, then the recipient must have
-            # that filenode.
+            # drop any nodes that claim to be part of a cset in commonrevs
+            drop = set()
             for n in missingnodes:
-                clrev = revlog.linkrev(revlog.rev(n))
-                if clrev in commonrevs:
-                    hasset.add(n)
-            for n in hasset:
+                if revlog.linkrev(revlog.rev(n)) in commonrevs:
+                    drop.add(n)
+            for n in drop:
                 missingnodes.pop(n, None)
-            for r in revlog.ancestors(*[revlog.rev(n) for n in hasset]):
-                missingnodes.pop(revlog.node(r), None)
 
         # Now that we have all theses utility functions to help out and
         # logically divide up the task, generate the group.