Bug 1835708 - Upgrade mercurial to 6.4.3 in docker images. r=sheehan

Differential Revision: https://phabricator.services.mozilla.com/D179392
This commit is contained in:
Mike Hommey
2023-05-30 20:51:50 +00:00
parent 409c766e94
commit c0e2bc6adb
4 changed files with 17 additions and 49 deletions

View File

@@ -1,38 +0,0 @@
# HG changeset patch
# User Julien Cristau <jcristau@mozilla.com>
# 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,

View File

@@ -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"

View File

@@ -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

View File

@@ -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