From c0e2bc6adb9435cab9c09072d208f83c4f40ab8c Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 30 May 2023 20:51:50 +0000 Subject: [PATCH] Bug 1835708 - Upgrade mercurial to 6.4.3 in docker images. r=sheehan Differential Revision: https://phabricator.services.mozilla.com/D179392 --- build/debian-packages/mercurial-timeout.diff | 38 ------------------- taskcluster/ci/packages/debian.yml | 5 +-- taskcluster/ci/packages/ubuntu.yml | 10 ++--- .../external_tools/robustcheckout.py | 13 ++++++- 4 files changed, 17 insertions(+), 49 deletions(-) delete mode 100644 build/debian-packages/mercurial-timeout.diff diff --git a/build/debian-packages/mercurial-timeout.diff b/build/debian-packages/mercurial-timeout.diff deleted file mode 100644 index adc5a0f34110..000000000000 --- a/build/debian-packages/mercurial-timeout.diff +++ /dev/null @@ -1,38 +0,0 @@ -# HG changeset patch -# User Julien Cristau -# Date 1679408823 -3600 -# Tue Mar 21 15:27:03 2023 +0100 -# Branch stable -# Node ID 3a889388b8f5e4fc884fd7eb6c5daf82056627e2 -# Parent 411dc27fd9fd076d6a031a08fcaace659afe2fe3 -url: don't ignore timeout for https connections - -For http, we use the stdlib's HTTPConnection.connect which passes the -timeout down to socket.create_connection; for https, we override the -connect method but weren't handling the timeout, so connections could -hang for hours even with http.timeout set to low values. - -diff --git a/mercurial/url.py b/mercurial/url.py ---- a/mercurial/url.py -+++ b/mercurial/url.py -@@ -404,17 +404,19 @@ if has_https: - *args, - **kwargs - ): - keepalive.HTTPConnection.__init__(self, host, port, *args, **kwargs) - self.key_file = key_file - self.cert_file = cert_file - - def connect(self): -- self.sock = socket.create_connection((self.host, self.port)) -+ self.sock = socket.create_connection( -+ (self.host, self.port), self.timeout -+ ) - - host = self.host - if self.realhostport: # use CONNECT proxy - _generic_proxytunnel(self) - host = self.realhostport.rsplit(b':', 1)[0] - self.sock = sslutil.wrapsocket( - self.sock, - self.key_file, diff --git a/taskcluster/ci/packages/debian.yml b/taskcluster/ci/packages/debian.yml index 0ded69cf6756..c8d959675bb4 100644 --- a/taskcluster/ci/packages/debian.yml +++ b/taskcluster/ci/packages/debian.yml @@ -15,14 +15,13 @@ deb11-mercurial: using: debian-package dist: bullseye tarball: - url: https://www.mercurial-scm.org/release/mercurial-5.8.1.tar.gz - sha256: 81baa3fe2087bdda2dd119d7ea948f6badebaeb7b528a7d18b277e2ceb22b19b + url: https://www.mercurial-scm.org/release/mercurial-6.4.3.tar.gz + sha256: a77fb62d325934a83a00b2fc6db109f44c67b86768fc40490366f513640c7f64 pre-build-command: >- cp -r contrib/packaging/debian debian && sed -i -e "s/__VERSION__/$(awk -F\" '$2 {print $2}' mercurial/__version__.py)-1.deb11moz1/" \ -e "s/__DATE__/$(date --rfc-2822)/" \ -e "s/__CODENAME__/bullseye/" debian/changelog - patch: mercurial-timeout.diff deb11-cmake: description: "cmake" diff --git a/taskcluster/ci/packages/ubuntu.yml b/taskcluster/ci/packages/ubuntu.yml index 1633d627f767..60f8eef25f84 100644 --- a/taskcluster/ci/packages/ubuntu.yml +++ b/taskcluster/ci/packages/ubuntu.yml @@ -61,8 +61,8 @@ ub18-mercurial: symbol: Ub18(hg) run: tarball: - url: https://www.mercurial-scm.org/release/mercurial-5.8.1.tar.gz - sha256: 81baa3fe2087bdda2dd119d7ea948f6badebaeb7b528a7d18b277e2ceb22b19b + url: https://www.mercurial-scm.org/release/mercurial-6.4.3.tar.gz + sha256: a77fb62d325934a83a00b2fc6db109f44c67b86768fc40490366f513640c7f64 pre-build-command: >- apt-get install python3.7-dev && export DEB_HG_PYTHON_VERSIONS="3.7" && @@ -71,7 +71,6 @@ ub18-mercurial: sed -i -e "s/__VERSION__/$(awk -F\" '$2 {print $2}' mercurial/__version__.py)-1.ub18moz1/" \ -e "s/__DATE__/$(date --rfc-2822)/" \ -e "s/__CODENAME__/bionic/" debian/changelog - patch: mercurial-timeout.diff ub20-python-zstandard: description: "python-zstandard for Ubuntu focal" @@ -91,12 +90,11 @@ ub20-mercurial: symbol: Ub20(hg) run: tarball: - url: https://www.mercurial-scm.org/release/mercurial-5.8.1.tar.gz - sha256: 81baa3fe2087bdda2dd119d7ea948f6badebaeb7b528a7d18b277e2ceb22b19b + url: https://www.mercurial-scm.org/release/mercurial-6.4.3.tar.gz + sha256: a77fb62d325934a83a00b2fc6db109f44c67b86768fc40490366f513640c7f64 dist: focal pre-build-command: >- cp -r contrib/packaging/debian debian && sed -i -e "s/__VERSION__/$(awk -F\" '$2 {print $2}' mercurial/__version__.py)-1.ub20moz1/" \ -e "s/__DATE__/$(date --rfc-2822)/" \ -e "s/__CODENAME__/focal/" debian/changelog - patch: mercurial-timeout.diff diff --git a/testing/mozharness/external_tools/robustcheckout.py b/testing/mozharness/external_tools/robustcheckout.py index 7c270e9269d6..76e0a4a15104 100644 --- a/testing/mozharness/external_tools/robustcheckout.py +++ b/testing/mozharness/external_tools/robustcheckout.py @@ -41,7 +41,9 @@ from mercurial import ( # Causes worker to purge caches on process exit and for task to retry. EXIT_PURGE_CACHE = 72 -testedwith = b"4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9" +testedwith = ( + b"4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4" +) minimumhgversion = b"4.5" cmdtable = {} @@ -806,7 +808,14 @@ def _docheckout( # one to change the sparse profile and another to update to the new # revision. This is not desired. But there's not a good API in # Mercurial to do this as one operation. - with repo.wlock(), repo.dirstate.parentchange(), timeit( + # TRACKING hg64 - Mercurial 6.4 and later require call to + # dirstate.changing_parents(repo) + def parentchange(repo): + if util.safehasattr(repo.dirstate, "changing_parents"): + return repo.dirstate.changing_parents(repo) + return repo.dirstate.parentchange() + + with repo.wlock(), parentchange(repo), timeit( "sparse_update_config", "sparse-update-config" ): # pylint --py3k: W1636