changeset 13712:c4706accf310

changegroupsubset: use manifest.readfast to simplify collector
author Matt Mackall <mpm@selenic.com>
date Sun, 20 Mar 2011 19:43:28 -0500
parents ed913fd7837b
children ee4f7109457e
files mercurial/localrepo.py
diffstat 1 files changed, 5 insertions(+), 19 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
@@ -1473,25 +1473,11 @@
             def collect(mnode):
                 r = mf.rev(mnode)
                 clnode = mfs[mnode]
-                if mf.deltaparent(r) in mf.parentrevs(r):
-                    # If the previous rev is one of the parents,
-                    # we only need to see a diff.
-                    deltamf = mf.readdelta(mnode)
-                    # For each line in the delta
-                    for f, fnode in deltamf.iteritems():
-                        # And if the file is in the list of files we care
-                        # about.
-                        if f in changedfiles:
-                            # Create the set of filenodes for the file if
-                            # there isn't one already.
-                            fnodes.setdefault(f, {}).setdefault(fnode, clnode)
-                else:
-                    # Otherwise we need a full manifest.
-                    m = mf.read(mnode)
-                    # For every file in we care about.
-                    for f in changedfiles:
-                        if f in m:
-                            fnodes.setdefault(f, {}).setdefault(m[f], clnode)
+                mdata = mf.readfast(mnode)
+                for f in changedfiles:
+                    if f in mdata:
+                        fnodes.setdefault(f, {}).setdefault(mdata[f], clnode)
+
             return collect
 
         # If we determine that a particular file or manifest node must be a