changeset 38941:4c99c6d1ef95

changegroup: rename cg1packer to cgpacker There is now only a single class. We don't need to encode the version in its name since the version is a lie. Differential Revision: https://phab.mercurial-scm.org/D4084
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 03 Aug 2018 10:35:10 -0700
parents 23ae0c07a3e1
children 68e490ed640e
files mercurial/changegroup.py
diffstat 1 files changed, 22 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changegroup.py	Fri Aug 03 10:35:02 2018 -0700
+++ b/mercurial/changegroup.py	Fri Aug 03 10:35:10 2018 -0700
@@ -519,7 +519,7 @@
     # Iterable of chunks holding raw delta data.
     deltachunks = attr.ib()
 
-class cg1packer(object):
+class cgpacker(object):
     def __init__(self, repo, filematcher, version, allowreorder,
                  useprevdelta, builddeltaheader, manifestsend,
                  sendtreemanifests, bundlecaps=None):
@@ -1175,12 +1175,13 @@
     builddeltaheader = lambda d: _CHANGEGROUPV1_DELTA_HEADER.pack(
         d.node, d.p1node, d.p2node, d.linknode)
 
-    return cg1packer(repo, filematcher, b'01',
-                     useprevdelta=True,
-                     allowreorder=None,
-                     builddeltaheader=builddeltaheader,
-                     manifestsend=b'', sendtreemanifests=False,
-                     bundlecaps=bundlecaps)
+    return cgpacker(repo, filematcher, b'01',
+                    useprevdelta=True,
+                    allowreorder=None,
+                    builddeltaheader=builddeltaheader,
+                    manifestsend=b'',
+                    sendtreemanifests=False,
+                    bundlecaps=bundlecaps)
 
 def _makecg2packer(repo, filematcher, bundlecaps):
     builddeltaheader = lambda d: _CHANGEGROUPV2_DELTA_HEADER.pack(
@@ -1189,23 +1190,25 @@
     # Since generaldelta is directly supported by cg2, reordering
     # generally doesn't help, so we disable it by default (treating
     # bundle.reorder=auto just like bundle.reorder=False).
-    return cg1packer(repo, filematcher, b'02',
-                     useprevdelta=False,
-                     allowreorder=False,
-                     builddeltaheader=builddeltaheader,
-                     manifestsend=b'', sendtreemanifests=False,
-                     bundlecaps=bundlecaps)
+    return cgpacker(repo, filematcher, b'02',
+                    useprevdelta=False,
+                    allowreorder=False,
+                    builddeltaheader=builddeltaheader,
+                    manifestsend=b'',
+                    sendtreemanifests=False,
+                    bundlecaps=bundlecaps)
 
 def _makecg3packer(repo, filematcher, bundlecaps):
     builddeltaheader = lambda d: _CHANGEGROUPV3_DELTA_HEADER.pack(
         d.node, d.p1node, d.p2node, d.basenode, d.linknode, d.flags)
 
-    return cg1packer(repo, filematcher, b'03',
-                     useprevdelta=False,
-                     allowreorder=False,
-                     builddeltaheader=builddeltaheader,
-                     manifestsend=closechunk(), sendtreemanifests=True,
-                     bundlecaps=bundlecaps)
+    return cgpacker(repo, filematcher, b'03',
+                    useprevdelta=False,
+                    allowreorder=False,
+                    builddeltaheader=builddeltaheader,
+                    manifestsend=closechunk(),
+                    sendtreemanifests=True,
+                    bundlecaps=bundlecaps)
 
 _packermap = {'01': (_makecg1packer, cg1unpacker),
              # cg2 adds support for exchanging generaldelta