changeset 32260:e17b8466857e

bundle: handle compression earlier We can also handle that part before starting any generation.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 04 May 2017 21:47:03 +0200
parents 38d2f9e5df40
children 9dc36df78403
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu May 04 21:46:02 2017 +0200
+++ b/mercurial/commands.py	Thu May 04 21:47:03 2017 +0200
@@ -1384,8 +1384,6 @@
         raise error.ProgrammingError(
             'bundle: unexpected changegroup version %s' % cgversion)
 
-    cg = changegroup.getchangegroup(repo, 'bundle', outgoing, version=cgversion)
-
     # TODO compression options should be derived from bundlespec parsing.
     # This is a temporary hack to allow adjusting bundle compression
     # level without a) formalizing the bundlespec changes to declare it
@@ -1395,6 +1393,8 @@
     if complevel is not None:
         compopts['level'] = complevel
 
+    cg = changegroup.getchangegroup(repo, 'bundle', outgoing, version=cgversion)
+
     bundle2.writebundle(ui, cg, fname, bversion, compression=bcompression,
                         compopts=compopts)