Patchwork [3,of,6] bundle: handle compression earlier

login
register
mail settings
Submitter Pierre-Yves David
Date May 6, 2017, 8:04 a.m.
Message ID <ee3c4426ef5dde60a48c.1494057897@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/20480/
State Accepted
Headers show

Comments

Pierre-Yves David - May 6, 2017, 8:04 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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)