[PATCH 3 of 6] bundle: handle compression earlier

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat May 6 04:04:57 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1493927223 -7200
#      Thu May 04 21:47:03 2017 +0200
# Node ID ee3c4426ef5dde60a48c4133d65234ed96c832de
# Parent  711809dcb24b495e26c91cb482b3741af7d33458
# EXP-Topic bundle.cleanup
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r ee3c4426ef5d
bundle: handle compression earlier

We can also handle that part before starting any generation.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1383,8 +1383,6 @@ def bundle(ui, repo, fname, dest=None, *
         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
@@ -1394,6 +1392,8 @@ def bundle(ui, repo, fname, dest=None, *
     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)
 


More information about the Mercurial-devel mailing list