# HG changeset patch # User Pierre-Yves David # Date 2017-05-04 19:47:03 # Node ID e17b8466857e429d4f1261bf4c59056fc7046c74 # Parent 38d2f9e5df40c579130671457a3d66d76f70cdc7 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 @@ -1384,8 +1384,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 @@ -1395,6 +1393,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)