hgext/narrow/narrowwirepeer.py
changeset 40071 e8132a8897da
parent 40070 8feae5b989bc
child 40072 1ea80ac13f19
--- a/hgext/narrow/narrowwirepeer.py	Fri Sep 28 23:42:31 2018 +0300
+++ b/hgext/narrow/narrowwirepeer.py	Tue Oct 02 17:09:56 2018 +0300
@@ -69,7 +69,6 @@
     ellipses: whether to send ellipses data or not
     """
 
-    bundler = bundle2.bundle20(repo.ui)
     try:
         oldincludes = wireprototypes.decodelist(oldincludes)
         newincludes = wireprototypes.decodelist(newincludes)
@@ -96,15 +95,10 @@
                                     exclude=oldexcludes)
         diffmatch = matchmod.differencematcher(newmatch, oldmatch)
 
-        # get changegroup data
-        cg = narrowbundle2.widen_bundle(repo, diffmatch, common, known,
-                                        cgversion, ellipses)
-        if cg is not None:
-            part = bundler.newpart('changegroup', data=cg)
-            part.addparam('version', cgversion)
-            if 'treemanifest' in repo.requirements:
-                part.addparam('treemanifest', '1')
+        bundler = narrowbundle2.widen_bundle(repo, diffmatch, common, known,
+                                             cgversion, ellipses)
     except error.Abort as exc:
+        bundler = bundle2.bundle20(repo.ui)
         manargs = [('message', pycompat.bytestr(exc))]
         advargs = []
         if exc.hint is not None: