##// END OF EJS Templates
sidedatacopies: only fetch information once for merge...
sidedatacopies: only fetch information once for merge Before this change, merge would result in reading the data from revlog twice. With this change, we keep the information in memory until we encounter the other parent. When looking at pypy, I see about 1/3 of the changesets with copy information being merge. Not doing duplicated fetch for them provide a significant speedup. revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29 before: ! wall 0.767042 comb 0.760000 user 0.750000 sys 0.010000 (median of 11) after: ! wall 0.671162 comb 0.670000 user 0.650000 sys 0.020000 (median of 13) revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2 before: ! wall 1.170169 comb 1.170000 user 1.130000 sys 0.040000 (median of 10) after: ! wall 1.030596 comb 1.040000 user 1.010000 sys 0.030000 (median of 10) revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0 before: ! wall 0.209846 comb 0.200000 user 0.200000 sys 0.000000 (median of 46) after: ! wall 0.170981 comb 0.170000 user 0.170000 sys 0.000000 (median of 56) revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f before: ! wall 0.013248 comb 0.010000 user 0.010000 sys 0.000000 (median of 223) after: ! wall 0.013295 comb 0.020000 user 0.020000 sys 0.000000 (median of 222) revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63 before: ! wall 0.001672 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000) after: ! wall 0.001666 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000) revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e before: ! wall 0.000119 comb 0.000000 user 0.000000 sys 0.000000 (median of 8010) after: ! wall 0.000119 comb 0.000000 user 0.000000 sys 0.000000 (median of 8007) revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe before: ! wall 0.168599 comb 0.160000 user 0.160000 sys 0.000000 (median of 58) after: ! wall 0.133316 comb 0.140000 user 0.140000 sys 0.000000 (median of 73) revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d before: ! wall 0.036052 comb 0.030000 user 0.030000 sys 0.000000 (median of 100) after: ! wall 0.032558 comb 0.030000 user 0.030000 sys 0.000000 (median of 100) Differential Revision: https://phab.mercurial-scm.org/D7127

File last commit:

r43346:2372284d default
r43595:90213d02 default
Show More
build.py
96 lines | 2.9 KiB | text/x-python | PythonLexer
#!/usr/bin/env python3
# Copyright 2019 Gregory Szorc <gregory.szorc@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
# no-check-code because Python 3 native.
"""Code to build Mercurial WiX installer."""
import argparse
import os
import pathlib
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--name', help='Application name', default='Mercurial')
parser.add_argument(
'--python', help='Path to Python executable to use', required=True
)
parser.add_argument(
'--sign-sn',
help='Subject name (or fragment thereof) of certificate '
'to use for signing',
)
parser.add_argument(
'--sign-cert', help='Path to certificate to use for signing'
)
parser.add_argument(
'--sign-password', help='Password for signing certificate'
)
parser.add_argument(
'--sign-timestamp-url',
help='URL of timestamp server to use for signing',
)
parser.add_argument('--version', help='Version string to use')
parser.add_argument(
'--extra-packages-script',
help=(
'Script to execute to include extra packages in ' 'py2exe binary.'
),
)
parser.add_argument(
'--extra-wxs', help='CSV of path_to_wxs_file=working_dir_for_wxs_file'
)
parser.add_argument(
'--extra-features',
help=(
'CSV of extra feature names to include '
'in the installer from the extra wxs files'
),
)
args = parser.parse_args()
here = pathlib.Path(os.path.abspath(os.path.dirname(__file__)))
source_dir = here.parent.parent.parent
sys.path.insert(0, str(source_dir / 'contrib' / 'packaging'))
from hgpackaging.wix import (
build_installer,
build_signed_installer,
)
fn = build_installer
kwargs = {
'source_dir': source_dir,
'python_exe': pathlib.Path(args.python),
'version': args.version,
}
if not os.path.isabs(args.python):
raise Exception('--python arg must be an absolute path')
if args.extra_packages_script:
kwargs['extra_packages_script'] = args.extra_packages_script
if args.extra_wxs:
kwargs['extra_wxs'] = dict(
thing.split("=") for thing in args.extra_wxs.split(',')
)
if args.extra_features:
kwargs['extra_features'] = args.extra_features.split(',')
if args.sign_sn or args.sign_cert:
fn = build_signed_installer
kwargs['name'] = args.name
kwargs['subject_name'] = args.sign_sn
kwargs['cert_path'] = args.sign_cert
kwargs['cert_password'] = args.sign_password
kwargs['timestamp_url'] = args.sign_timestamp_url
fn(**kwargs)