Patchwork [3,of,3] changegroup.group: drop 'reorder' parameter

login
register
mail settings
Submitter Martin von Zweigbergk
Date May 2, 2015, 4:45 a.m.
Message ID <ba96fc4e231403870de0.1430541929@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/8844/
State Accepted
Commit e285b98c65ccf55314b729ed6f1b46ac75b44bab
Headers show

Comments

Martin von Zweigbergk - May 2, 2015, 4:45 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1430328658 25200
#      Wed Apr 29 10:30:58 2015 -0700
# Node ID ba96fc4e231403870de0899c204c2b878c0188aa
# Parent  43d0a6aab2e0e2b9be3a603237ab52d3dc3455c4
changegroup.group: drop 'reorder' parameter

Since we always pass self._reorder to self.group(), let's drop the
parameter and let group() read from self._reorder itself. There are no
other in-tree callers to group().
Matt Mackall - May 4, 2015, 5:34 p.m.
On Fri, 2015-05-01 at 21:45 -0700, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1430328658 25200
> #      Wed Apr 29 10:30:58 2015 -0700
> # Node ID ba96fc4e231403870de0899c204c2b878c0188aa
> # Parent  43d0a6aab2e0e2b9be3a603237ab52d3dc3455c4
> changegroup.group: drop 'reorder' parameter

These are queued for default, thanks.

Patch

diff -r 43d0a6aab2e0 -r ba96fc4e2314 mercurial/changegroup.py
--- a/mercurial/changegroup.py	Wed Apr 29 10:38:45 2015 -0700
+++ b/mercurial/changegroup.py	Wed Apr 29 10:30:58 2015 -0700
@@ -304,7 +304,7 @@ 
     def fileheader(self, fname):
         return chunkheader(len(fname)) + fname
 
-    def group(self, nodelist, revlog, lookup, units=None, reorder=None):
+    def group(self, nodelist, revlog, lookup, units=None):
         """Calculate a delta group, yielding a sequence of changegroup chunks
         (strings).
 
@@ -325,7 +325,7 @@ 
 
         # for generaldelta revlogs, we linearize the revs; this will both be
         # much quicker and generate a much smaller bundle
-        if (revlog._generaldelta and reorder is None) or reorder:
+        if (revlog._generaldelta and self._reorder is None) or self._reorder:
             dag = dagutil.revlogdag(revlog)
             revs = set(revlog.rev(n) for n in nodelist)
             revs = dag.linearize(revs)
@@ -381,8 +381,7 @@ 
 
         self._verbosenote(_('uncompressed size of bundle content:\n'))
         size = 0
-        for chunk in self.group(clnodes, cl, lookupcl, units=_('changesets'),
-                                reorder=reorder):
+        for chunk in self.group(clnodes, cl, lookupcl, units=_('changesets')):
             size += len(chunk)
             yield chunk
         self._verbosenote(_('%8.i (changelog)\n') % size)
@@ -406,8 +405,7 @@ 
 
         mfnodes = self.prune(ml, mfs, commonrevs)
         size = 0
-        for chunk in self.group(mfnodes, ml, lookupmf, units=_('manifests'),
-                                reorder=reorder):
+        for chunk in self.group(mfnodes, ml, lookupmf, units=_('manifests')):
             size += len(chunk)
             yield chunk
         self._verbosenote(_('%8.i (manifests)\n') % size)
@@ -439,7 +437,6 @@ 
     def generatefiles(self, changedfiles, linknodes, commonrevs, source):
         repo = self._repo
         progress = self._progress
-        reorder = self._reorder
         msgbundling = _('bundling')
 
         total = len(changedfiles)
@@ -463,8 +460,7 @@ 
                 h = self.fileheader(fname)
                 size = len(h)
                 yield h
-                for chunk in self.group(filenodes, filerevlog, lookupfilelog,
-                                        reorder=reorder):
+                for chunk in self.group(filenodes, filerevlog, lookupfilelog):
                     size += len(chunk)
                     yield chunk
                 self._verbosenote(_('%8.i  %s\n') % (size, fname))