changegroup: add revlog to the group callback
authorMatt Mackall <mpm@selenic.com>
Mon, 28 Mar 2011 11:18:56 -0500
changeset 13785 470ec600b525
parent 13784 f1e639c71a2b
child 13786 4ed718f909e5
changegroup: add revlog to the group callback
mercurial/localrepo.py
mercurial/revlog.py
--- a/mercurial/localrepo.py	Mon Mar 28 11:18:56 2011 -0500
+++ b/mercurial/localrepo.py	Mon Mar 28 11:18:56 2011 -0500
@@ -1532,7 +1532,7 @@
 
             collect = changegroup.collector(cl, mfs, changedfiles)
             count = [0]
-            def clookup(x):
+            def clookup(revlog, x):
                 collect(x)
                 count[0] += 1
                 self.ui.progress(_('bundling'), count[0], unit=_('changesets'))
@@ -1551,7 +1551,7 @@
             # and data collection functions back.
             fcollect = filenode_collector(changedfiles)
             count = [0]
-            def mlookup(x):
+            def mlookup(revlog, x):
                 fcollect(x)
                 count[0] += 1
                 self.ui.progress(_('bundling'), count[0],
@@ -1581,7 +1581,7 @@
                     # Create a group generator and only pass in a changenode
                     # lookup function as we need to collect no information
                     # from filenodes.
-                    def flookup(x):
+                    def flookup(revlog, x):
                         # even though we print the same progress on
                         # most loop iterations, put the progress call
                         # here so that time estimates (if any) can be updated
@@ -1639,7 +1639,7 @@
 
             collect = changegroup.collector(cl, mmfs, changedfiles)
             count = [0]
-            def clookup(x):
+            def clookup(revlog, x):
                 count[0] += 1
                 self.ui.progress(_('bundling'), count[0], unit=_('changesets'))
                 collect(x)
@@ -1655,7 +1655,7 @@
             nodeiter = gennodelst(mnfst)
             mfunc = lookuplinkrev_func(mnfst)
             count = [0]
-            def mlookup(x):
+            def mlookup(revlog, x):
                 count[0] += 1
                 self.ui.progress(_('bundling'), count[0],
                                  unit=_('manifests'), total=changecount)
@@ -1675,7 +1675,7 @@
                     yield changegroup.chunkheader(len(fname))
                     yield fname
                     ffunc = lookuplinkrev_func(filerevlog)
-                    def flookup(x):
+                    def flookup(revlog, x):
                         self.ui.progress(
                             _('bundling'), idx, item=fname,
                             total=efiles, unit=_('files'))
--- a/mercurial/revlog.py	Mon Mar 28 11:18:56 2011 -0500
+++ b/mercurial/revlog.py	Mon Mar 28 11:18:56 2011 -0500
@@ -1087,7 +1087,7 @@
             nb = self.node(b)
 
             p = self.parents(nb)
-            meta = nb + p[0] + p[1] + lookup(nb)
+            meta = nb + p[0] + p[1] + lookup(self, nb)
             if a == nullrev:
                 d = self.revision(nb)
                 meta += mdiff.trivialdiffheader(len(d))