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
--- 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):