hgserver: use Mercurial 4.1 for generating clone bundles (bug 1331084); r?glob draft
authorGregory Szorc <gps@mozilla.com>
Fri, 27 Jan 2017 15:08:07 -0800
changeset 10288 a65c30536781cd049ba2186273c5e151f4c0da5f
parent 10287 650a5bb04dcba19fa0fa5122c62c3ce853927c72
child 10289 3b630e5f5407559fe1d68372089a17af2b1c4881
push id1505
push userbmo:gps@mozilla.com
push dateWed, 01 Feb 2017 19:22:14 +0000
reviewersglob
bugs1331084
hgserver: use Mercurial 4.1 for generating clone bundles (bug 1331084); r?glob Now that we have Mercurial 4.1 installed, let's use it for clone bundle generation. We only use Mercurial 4.1 for the invocation of the `hg bundle` process and nothing more. The script itself still runs out of the "tools" virtualenv. MozReview-Commit-ID: AXJDwq8HF5x
scripts/generate-hg-s3-bundles
--- a/scripts/generate-hg-s3-bundles
+++ b/scripts/generate-hg-s3-bundles
@@ -12,17 +12,20 @@ import json
 import os
 import shutil
 import subprocess
 
 from boto.s3.connection import S3Connection
 import concurrent.futures as futures
 
 
+# Use a separate hg for bundle generation for zstd support until we roll
+# out Mercurial 4.1 everywhere.
 HG = '/var/hg/venv_tools/bin/hg'
+HG_BUNDLE = '/var/hg/venv_hg_pre/bin/hg'
 PUSH_REPO = '/var/hg/version-control-tools/scripts/push-repo.sh'
 
 # The types of bundles to generate.
 #
 # Define in order bundles should be listed in manifest.
 CREATES = [
     ('gzip', ['bundle', '-a', '-t', 'gzip-v1'], {}),
     ('gzip-v2', ['bundle', '-a', '-t', 'gzip-v2'], {'gd': True}),
@@ -156,17 +159,17 @@ def bundle_paths(root, repo, tag, typ):
     return final_path, remote_path
 
 def generate_bundle(repo, temp_path, final_path, extra_args):
     """Generate a single bundle from arguments.
 
     Generates using the command specified by ``extra_args`` into ``temp_path``
     before moving the fully created bundle to ``final_path``.
     """
-    args = [HG,
+    args = [HG_BUNDLE,
             '--config', 'extensions.vcsreplicator=!',
             '-R', repo] + extra_args + [temp_path]
     subprocess.check_call(args)
     os.rename(temp_path, final_path)
 
 
 def generate_bundles(repo, upload=True, bzip2=False, copyfrom=None,
                      legacy_stream=False):