From d5d36fc823b7189d033e69314ae2764f1eed9168 Mon Sep 17 00:00:00 2001
From: V3n3RiX <venerix@koprulu.sector>
Date: Wed, 26 Apr 2023 06:14:16 +0100
Subject: gentoo auto-resync : 26:04:2023 - 06:14:16

---
 dev-vcs/Manifest.gz                        | Bin 11530 -> 11540 bytes
 dev-vcs/git/Manifest                       |   8 +
 dev-vcs/git/git-2.39.3.ebuild              | 644 +++++++++++++++++++++++++++++
 dev-vcs/git/git-2.40.1.ebuild              | 644 +++++++++++++++++++++++++++++
 dev-vcs/pre-commit/Manifest                |   2 +-
 dev-vcs/pre-commit/pre-commit-3.2.2.ebuild |   2 +-
 dev-vcs/tortoisehg/Manifest                |   4 +-
 dev-vcs/tortoisehg/tortoisehg-6.4.2.ebuild |  81 ++++
 dev-vcs/tortoisehg/tortoisehg-9999.ebuild  |   6 +-
 9 files changed, 1385 insertions(+), 6 deletions(-)
 create mode 100644 dev-vcs/git/git-2.39.3.ebuild
 create mode 100644 dev-vcs/git/git-2.40.1.ebuild
 create mode 100644 dev-vcs/tortoisehg/tortoisehg-6.4.2.ebuild

(limited to 'dev-vcs')

diff --git a/dev-vcs/Manifest.gz b/dev-vcs/Manifest.gz
index 0bf6ee4a2e27..1ec1707f286d 100644
Binary files a/dev-vcs/Manifest.gz and b/dev-vcs/Manifest.gz differ
diff --git a/dev-vcs/git/Manifest b/dev-vcs/git/Manifest
index 994ec9680e42..70def95ef576 100644
--- a/dev-vcs/git/Manifest
+++ b/dev-vcs/git/Manifest
@@ -9,16 +9,24 @@ AUX git-daemon.xinetd 260 BLAKE2B 594a046b5b2b580b7cfed1b620e014160965046c5e5a42
 AUX git-daemon_at-r1.service 340 BLAKE2B 879db8b274d8e1d2995a2ea1e4b1d66cac3d6979006fc24721db8b389395ac98a98444f032eaf7c66d6c02ab394a764e16a9cd3b5446b6be9061b9bdd89cf964 SHA512 073d8752dc224ff1130a5290e0f965a04b19f2a8dbd5d50172101099386ad3af0fd5e1abf57030960b750a2adf36a7ae69d18ddc990bab4e694486e65424cfa9
 DIST git-2.39.1.tar.xz 7160744 BLAKE2B 5ebf583232da9f6a937ebba17858b9fa8b550e3d0d981ff5603f77673cce69bf9a3c1c18c61d4c5e6b2f629a8173eaef8a09c913961d175571e4e6b00d2b194d SHA512 b1821a814947f01adf98206a7e9a01da9daa617b1192e8ef6968b05af8d874f028fb26b5f828a9c48f734ef2c276f4d23bdc898ba46fb7aaa96dbe68081037e9
 DIST git-2.39.2.tar.xz 7163224 BLAKE2B bcd9abdaf8ce626de7aec2da666395f80212772aa17516f903459d683597184efeeb1d6aad536e0bf722a9bf63df98549fdeaab5b0a48e5500faf83ebf5d7516 SHA512 fdca70bee19401c5c7a6d2f3d70bd80b6ba99f6a9f97947de31d4366ee3a78a18d5298abb25727ec8ef67131bca673e48dff2a5a050b6e032884ab04066b20cb
+DIST git-2.39.3.tar.xz 7166100 BLAKE2B 862a5636df681e46797034bf22ca7712d70ead94ac0a911b81e4eeb3c83e67fdc56b839055b3b54bdab0ffceabe9fa2efb9e2870b1c0f40590ddb33e7427cd2a SHA512 ddd9f41df9d59aedaddb3a3cd551c105903b5f8c86455d4d05a8342920d67754b358b6ab0d6c10cca743b8e0e621baea16f71a9d6290f4d37297a9c45e8b3763
 DIST git-2.40.0.tar.xz 7183692 BLAKE2B e2687ceb7e341170f063013c8c0e8be81456cda786981f36170aefb714687d78cf850287e5fb35d98e7326f611881ffd27d380728c87b9306fbbe46c1b989d69 SHA512 a2720f8f9a0258c0bb5e23badcfd68a147682e45a5d039a42c47128296c508109d5039029db89311a35db97a9008585e84ed11b400846502c9be913d67f0fd90
+DIST git-2.40.1.tar.xz 7185260 BLAKE2B 50957227a572db54b931976d4c22edeaf0d5678d05d37f9478e736487d3e0755c1d70775cea9e3ce82e07f228fa809f3b461fb5b7f267117cc5aeffff915c096 SHA512 9ab41c64c6e666c314683bc4925535e037d43f947b8d327ff7d0379ac12899f4effcc2fe4e47b1ce652ad7140aa4f01f3b99f9cc0cf854cfeface1a5d3e1893e
 DIST git-htmldocs-2.39.1.tar.xz 1504172 BLAKE2B 64a73a2b04e99b0bf18ab2153076bcbae9c114a31c9ab998c5e068f0ce6c0f5140e9db79008b1b01688db6a6d53e84fde8b2319eb45394aa6bc2df361be78520 SHA512 9b67b0464acd5651ef5871f724c59c910195cdd7020ecdcadced6e8e1275269ee1ca5808881e67e908114cb4ef27c959320f1e3d718b6699d3761281b6179600
 DIST git-htmldocs-2.39.2.tar.xz 1505352 BLAKE2B 8b60f9bae9585aab8782f38ff64391a9c8fddeed47d84a989b4f65db87c14e927d1d975fa5239435e921dbc74a75c600d6f0485defa1a235a66355c0f8d9060d SHA512 fe0982e653784285bce7f158956892900ae9c88aa986261de4184e3349e34ee54f92d7280e143031b107872fc1729814489f6e355aa12dc415d724da65ec3716
+DIST git-htmldocs-2.39.3.tar.xz 1506828 BLAKE2B 732e86ee004a44230d8f10eac16a14fbfb348d4278001011a0d22ba91240fbe65cad341b0547b649db3ce7fc67fc6fb544c896e7ba4bd7f1fa3c9b42371febf9 SHA512 7616c9c6600759f06973d36d5233b3909da72f39318410f5522b890d282a74e7585433c7195fed4792d5b7955292a466abcc2185ffdc23d0e8928ad58d7db1bf
 DIST git-htmldocs-2.40.0.tar.xz 1517292 BLAKE2B 1baa47344e8c41c529e6ea21fa9ab406d146e128c2154beceb1d2ddf993cebdfeca132ed86811ef062df38e1ecc541dd2285bca0d985e7cc8ce185422d53f9b4 SHA512 3295e6b5e69430b3900ade93484cc357dd69d59ffccef0b62648d4aefc5d3e0820bd81dde2ec5ad0f3983c9c3a3648fa6edea508e870ebc0194cf6d42137aee2
+DIST git-htmldocs-2.40.1.tar.xz 1517900 BLAKE2B 864edd5b2389362dcf5d0c9f08cbf3bac6303cf6505b2d5446e73aeb591ac9212948b6f68434671e3bfba6f64d6aff02d315848d08647d22177292775411e5b3 SHA512 770c9765bab1f0773615d67f4eb817c42e1a946da205381ac0c208c4b2d4185c351aebbd7294afe66ef794b65cc9123b255a585a3df2990b5dfe779aaacb0800
 DIST git-manpages-2.39.1.tar.xz 557012 BLAKE2B 1a39a1192443eac0d12da059e0146d286272054192810d12f53f627bd341c3dc50bea2078cccac0d46c5e95502a1d669f072ab387e1662c890e5c38d46ad3f31 SHA512 4f1fdd7abf53dd60478ffc5f926777cd00446a3799ad9a2129814adfe7d3d63e13dd9bcdcea699fd139c9e134cf45857f0585ce2772e4fb93e4930c8f86a08bb
 DIST git-manpages-2.39.2.tar.xz 557080 BLAKE2B 6b2dbb33f1041ba802582f529638b8b4574309efbf5af94add5c676efed7314743d5b326ec18a95ba85a4fe818e95913069717034a9863879e1d03ee32b839ba SHA512 6326ff43564fc42ca0a424edd17896434e11c09ce21f4bfd4d4975aaaf7f2c0d823da0e89b267557b0b7799c342db88d84685d24f589f53edfe486208c1f15b1
+DIST git-manpages-2.39.3.tar.xz 557428 BLAKE2B 4eb85035f7056a12c3f1276d26f99b3337b97721f8f4b0b3c74d2a484171bfdf74f566a03e175ba32b389c940ed7be66ce2933442ec77089d5db3aaeb2ed2557 SHA512 06414741667b990ff3a28f7cb29b502df3d4cc757d525438994af005c71d429ca969563a74d1d2b44185e5c40107ac8838b390835a8a947e542ce3636b43f98b
 DIST git-manpages-2.40.0.tar.xz 562824 BLAKE2B 9e57d39c2111fc3a109d355773bc191110ac421bc1b0b9bdeeb13e84d8934ad4bdb8c7439bc7fe8f1ffea505e4ea6d14ab4fdf689e828e841cf0af8d2eb3cd12 SHA512 7415db5fd30239c7f5a51c40c3e94870ef6896df0d78a88bbe91c38d58e4d9802e12e1de2cb03634a52ad4a5877c9d7e1194c284567288ed4263788c48c8cff0
+DIST git-manpages-2.40.1.tar.xz 562772 BLAKE2B 091c907195b37ed4152698515528d7da27f8dbf2516915ae66ba6f81a64bbd9f2042544889fe655ea7447bd6f32adaf8daec9c02743587a84b090554ad58796b SHA512 4e75f5ae3786658d284ce8eae3133c01115e357cc0bd2c4c5bf4261196411da632f51c87ff6e4c1f4bc7adf7b7b4a33c4debe52bcd9b5d735aa70dd9614ad5bd
 EBUILD git-2.39.1.ebuild 16288 BLAKE2B b898d1bb457aed752fb2a6627507e47c036e199379d5f4a46ae23e66a31cbc2ddf78197c30cd1117cd8015bde5f351abb3fcc0ecccd6acac460d784ac18a964f SHA512 53a94810d173a7bd89404f2ca1aca4529cfd487535ef4cc4b7275c4ceef5edb75f46f01e9ad8d96bf7a72638711c22dda875efcc74376d5e58e08097749680b4
 EBUILD git-2.39.2.ebuild 16288 BLAKE2B b898d1bb457aed752fb2a6627507e47c036e199379d5f4a46ae23e66a31cbc2ddf78197c30cd1117cd8015bde5f351abb3fcc0ecccd6acac460d784ac18a964f SHA512 53a94810d173a7bd89404f2ca1aca4529cfd487535ef4cc4b7275c4ceef5edb75f46f01e9ad8d96bf7a72638711c22dda875efcc74376d5e58e08097749680b4
+EBUILD git-2.39.3.ebuild 16296 BLAKE2B af0d614af8b6e7cfa36460c4d67c3d27d37d7317cffeb94dd0ef7a9edda5f9d0fe378fa4ef6534461f0daeb87806cd2100ef1b892a378da67967b9aa304ba830 SHA512 bb0879fdf8144305fdb80b990e45601891d4bc97bbd75b4533dd90157f8f2514d951744a67c36ce2290011bb6a05daacc70268be216e7f8ff561651884068963
 EBUILD git-2.40.0.ebuild 16296 BLAKE2B af0d614af8b6e7cfa36460c4d67c3d27d37d7317cffeb94dd0ef7a9edda5f9d0fe378fa4ef6534461f0daeb87806cd2100ef1b892a378da67967b9aa304ba830 SHA512 bb0879fdf8144305fdb80b990e45601891d4bc97bbd75b4533dd90157f8f2514d951744a67c36ce2290011bb6a05daacc70268be216e7f8ff561651884068963
+EBUILD git-2.40.1.ebuild 16296 BLAKE2B af0d614af8b6e7cfa36460c4d67c3d27d37d7317cffeb94dd0ef7a9edda5f9d0fe378fa4ef6534461f0daeb87806cd2100ef1b892a378da67967b9aa304ba830 SHA512 bb0879fdf8144305fdb80b990e45601891d4bc97bbd75b4533dd90157f8f2514d951744a67c36ce2290011bb6a05daacc70268be216e7f8ff561651884068963
 EBUILD git-9999-r1.ebuild 16296 BLAKE2B af0d614af8b6e7cfa36460c4d67c3d27d37d7317cffeb94dd0ef7a9edda5f9d0fe378fa4ef6534461f0daeb87806cd2100ef1b892a378da67967b9aa304ba830 SHA512 bb0879fdf8144305fdb80b990e45601891d4bc97bbd75b4533dd90157f8f2514d951744a67c36ce2290011bb6a05daacc70268be216e7f8ff561651884068963
 EBUILD git-9999-r2.ebuild 16296 BLAKE2B af0d614af8b6e7cfa36460c4d67c3d27d37d7317cffeb94dd0ef7a9edda5f9d0fe378fa4ef6534461f0daeb87806cd2100ef1b892a378da67967b9aa304ba830 SHA512 bb0879fdf8144305fdb80b990e45601891d4bc97bbd75b4533dd90157f8f2514d951744a67c36ce2290011bb6a05daacc70268be216e7f8ff561651884068963
 EBUILD git-9999-r3.ebuild 16296 BLAKE2B af0d614af8b6e7cfa36460c4d67c3d27d37d7317cffeb94dd0ef7a9edda5f9d0fe378fa4ef6534461f0daeb87806cd2100ef1b892a378da67967b9aa304ba830 SHA512 bb0879fdf8144305fdb80b990e45601891d4bc97bbd75b4533dd90157f8f2514d951744a67c36ce2290011bb6a05daacc70268be216e7f8ff561651884068963
diff --git a/dev-vcs/git/git-2.39.3.ebuild b/dev-vcs/git/git-2.39.3.ebuild
new file mode 100644
index 000000000000..ce146cc61342
--- /dev/null
+++ b/dev-vcs/git/git-2.39.3.ebuild
@@ -0,0 +1,644 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+GENTOO_DEPEND_ON_PERL=no
+
+# bug #329479: git-remote-testgit is not multiple-version aware
+PYTHON_COMPAT=( python3_{9..11} )
+
+inherit toolchain-funcs perl-module bash-completion-r1 optfeature plocale python-single-r1 systemd
+
+PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
+
+if [[ ${PV} == *9999 ]]; then
+	EGIT_REPO_URI="https://git.kernel.org/pub/scm/git/git.git"
+
+	inherit git-r3
+	# Please ensure that all _four_ 9999 ebuilds get updated; they track the 4 upstream branches.
+	# See https://git-scm.com/docs/gitworkflows#_graduation
+	# In order of stability:
+	# 9999-r0: maint
+	# 9999-r1: master
+	# 9999-r2: next
+	# 9999-r3: seen
+	case ${PVR} in
+		9999) EGIT_BRANCH=maint ;;
+		9999-r1) EGIT_BRANCH=master ;;
+		9999-r2) EGIT_BRANCH=next;;
+		9999-r3) EGIT_BRANCH=seen ;;
+	esac
+fi
+
+MY_PV="${PV/_rc/.rc}"
+MY_P="${PN}-${MY_PV}"
+
+DOC_VER="${MY_PV}"
+
+DESCRIPTION="Stupid content tracker: distributed VCS designed for speed and efficiency"
+HOMEPAGE="https://www.git-scm.com/"
+
+if [[ ${PV} != *9999 ]]; then
+	SRC_URI_SUFFIX="xz"
+	SRC_URI_KORG="https://www.kernel.org/pub/software/scm/git"
+
+	[[ ${PV/rc} != ${PV} ]] && SRC_URI_KORG+='/testing'
+
+	SRC_URI="${SRC_URI_KORG}/${MY_P}.tar.${SRC_URI_SUFFIX}"
+	SRC_URI+=" ${SRC_URI_KORG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}"
+	SRC_URI+=" doc? ( ${SRC_URI_KORG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX} )"
+
+	if [[ ${PV} != *_rc* ]] ; then
+		KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+	fi
+fi
+
+S="${WORKDIR}"/${MY_P}
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="+blksha1 +curl cgi doc gnome-keyring +gpg highlight +iconv mediawiki +nls +pcre perforce +perl +safe-directory selinux subversion tk +webdav xinetd cvs test"
+
+# Common to both DEPEND and RDEPEND
+DEPEND="
+	dev-libs/openssl:=
+	sys-libs/zlib
+	curl? (
+		net-misc/curl
+		webdav? ( dev-libs/expat )
+	)
+	gnome-keyring? (
+		app-crypt/libsecret
+		dev-libs/glib:2
+	)
+	iconv? ( virtual/libiconv )
+	pcre? ( dev-libs/libpcre2:= )
+	perl? ( dev-lang/perl:=[-build(-)] )
+	tk? ( dev-lang/tk:= )
+"
+RDEPEND="
+	${DEPEND}
+	gpg? ( app-crypt/gnupg )
+	perl? (
+		dev-perl/Error
+		dev-perl/MailTools
+		dev-perl/Authen-SASL
+		>=virtual/perl-libnet-3.110.0-r4[ssl]
+		cgi? (
+			dev-perl/CGI
+			highlight? ( app-text/highlight )
+		)
+		cvs? (
+			>=dev-vcs/cvsps-2.1:0
+			dev-perl/DBI
+			dev-perl/DBD-SQLite
+		)
+		mediawiki? (
+			dev-perl/DateTime-Format-ISO8601
+			dev-perl/HTML-Tree
+			dev-perl/MediaWiki-API
+		)
+		subversion? (
+			dev-vcs/subversion[-dso(-),perl]
+			dev-perl/libwww-perl
+			dev-perl/TermReadKey
+		)
+	)
+	perforce? ( ${PYTHON_DEPS} )
+	selinux? ( sec-policy/selinux-git )
+"
+
+# This is how info docs are created with Git:
+#   .txt/asciidoc --(asciidoc)---------> .xml/docbook
+#   .xml/docbook  --(docbook2texi.pl)--> .texi
+#   .texi         --(makeinfo)---------> .info
+BDEPEND="
+	doc? (
+		app-text/asciidoc
+		app-text/docbook2X
+		app-text/xmlto
+		sys-apps/texinfo
+	)
+	gnome-keyring? ( virtual/pkgconfig )
+	nls? ( sys-devel/gettext )
+	test? (	app-crypt/gnupg	)
+"
+
+# Live ebuild builds man pages and HTML docs, additionally
+if [[ ${PV} == *9999 ]]; then
+	BDEPEND+=" app-text/asciidoc"
+fi
+
+SITEFILE="50${PN}-gentoo.el"
+
+REQUIRED_USE="
+	cgi? ( perl )
+	cvs? ( perl )
+	mediawiki? ( perl )
+	perforce? ( ${PYTHON_REQUIRED_USE} )
+	subversion? ( perl )
+	webdav? ( curl )
+"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	# Avoid automagic CVS, bug #350330
+	"${FILESDIR}"/git-2.37.0_rc1-optional-cvs.patch
+
+	# Make submodule output quiet
+	"${FILESDIR}"/git-2.21.0-quiet-submodules-testcase.patch
+)
+
+pkg_setup() {
+	if use subversion && has_version "dev-vcs/subversion[dso]" ; then
+		ewarn "Per Gentoo bugs #223747, #238586, when subversion is built"
+		ewarn "with USE=dso, there may be weird crashes in git-svn. You"
+		ewarn "have been warned!"
+	fi
+
+	if use perforce ; then
+		python-single-r1_pkg_setup
+	fi
+}
+
+# This is needed because for some obscure reasons future calls to make don't
+# pick up these exports if we export them in src_unpack()
+exportmakeopts() {
+	local extlibs myopts
+
+	myopts=(
+		ASCIIDOC_NO_ROFF=YesPlease
+
+		$(usex perl 'INSTALLDIRS=vendor NO_PERL_CPAN_FALLBACKS=YesPlease' NO_PERL=YesPlease)
+
+		$(usev elibc_musl NO_REGEX=NeedsStartEnd)
+		$(usev !cvs NO_CVS=YesPlease)
+		$(usev !iconv NO_ICONV=YesPlease)
+		$(usev !nls NO_GETTEXT=YesPlease)
+		$(usev !perforce NO_PYTHON=YesPlease)
+		$(usev !subversion NO_SVN_TESTS=YesPlease)
+		$(usev !tk NO_TCLTK=YesPlease)
+	)
+
+	if use blksha1 ; then
+		myopts+=( BLK_SHA1=YesPlease )
+	fi
+
+	if use curl ; then
+		use webdav || myopts+=( NO_EXPAT=YesPlease )
+	else
+		myopts+=( NO_CURL=YesPlease )
+	fi
+
+	# Broken assumptions because of static build system
+	myopts+=(
+		NO_FINK=YesPlease
+		NO_DARWIN_PORTS=YesPlease
+		INSTALL=install
+		TAR=tar
+		SHELL_PATH="${EPREFIX}/bin/sh"
+		SANE_TOOL_PATH=
+		OLD_ICONV=
+		NO_EXTERNAL_GREP=
+	)
+
+	# Can't define this to null, since the entire makefile depends on it
+	sed -i -e '/\/usr\/local/s/BASIC_/#BASIC_/' Makefile || die
+
+	if use pcre; then
+		myopts+=( USE_LIBPCRE2=YesPlease )
+		extlibs+=( -lpcre2-8 )
+	fi
+
+	if [[ ${CHOST} == *-solaris* ]]; then
+		myopts+=(
+			NEEDS_LIBICONV=YesPlease
+			HAVE_CLOCK_MONOTONIC=1
+		)
+
+		if grep -Fq getdelim "${ESYSROOT}"/usr/include/stdio.h ; then
+			myopts+=( HAVE_GETDELIM=1 )
+		fi
+	fi
+
+	myopts+=( ASCIIDOC8=YesPlease )
+
+	export MY_MAKEOPTS="${myopts[@]}"
+	export EXTLIBS="${extlibs[@]}"
+}
+
+src_unpack() {
+	if [[ ${PV} != *9999 ]] ; then
+		unpack ${MY_P}.tar.${SRC_URI_SUFFIX}
+
+		cd "${S}" || die
+		unpack ${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
+
+		if use doc ; then
+			pushd "${S}"/Documentation &>/dev/null || die
+			unpack ${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
+			popd &>/dev/null || die
+		fi
+	else
+		git-r3_src_unpack
+		#cp "${FILESDIR}"/GIT-VERSION-GEN . || die
+	fi
+
+}
+
+src_prepare() {
+	if ! use safe-directory ; then
+		# This patch neuters the "safe directory" detection.
+		# bugs #838271, #838223
+		PATCHES+=(
+			"${FILESDIR}"/git-2.37.2-unsafe-directory.patch
+		)
+	fi
+
+	default
+
+	if use prefix ; then
+		# bug #757309
+		eapply "${FILESDIR}"/git-2.37.2-darwin-prefix-gettext.patch
+	fi
+
+	sed -i \
+		-e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
+		-e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \
+		-e 's:^\(CC[[:space:]]* =\).*$:\1$(OPTCC):' \
+		-e 's:^\(AR[[:space:]]* =\).*$:\1$(OPTAR):' \
+		-e "s:\(PYTHON_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
+		-e "s:\(PERL_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
+		Makefile || die
+
+	# Fix docbook2texi command
+	sed -r -i 's/DOCBOOK2X_TEXI[[:space:]]*=[[:space:]]*docbook2x-texi/DOCBOOK2X_TEXI = docbook2texi.pl/' \
+		Documentation/Makefile || die
+}
+
+git_emake() {
+	# bug #320647: PYTHON_PATH
+	local PYTHON_PATH=""
+	use perforce && PYTHON_PATH="${PYTHON}"
+
+	local mymakeargs=(
+		${MY_MAKEOPTS}
+
+		prefix="${EPREFIX}"/usr
+		htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+		perllibdir="$(use perl && perl_get_raw_vendorlib)"
+		sysconfdir="${EPREFIX}"/etc
+
+		CC="$(tc-getCC)"
+		CFLAGS="${CFLAGS}"
+		PKG_CONFIG="$(tc-getPKG_CONFIG)"
+
+		# TODO: --verbose?
+		GIT_TEST_OPTS="--no-color"
+
+		OPTAR="$(tc-getAR)"
+		OPTCC="$(tc-getCC)"
+		OPTCFLAGS="${CFLAGS}"
+		OPTLDFLAGS="${LDFLAGS}"
+
+		PERL_PATH="${EPREFIX}/usr/bin/perl"
+		PERL_MM_OPT=""
+
+		PYTHON_PATH="${PYTHON_PATH}"
+
+		V=1
+		"$@"
+	)
+
+	emake "${mymakeargs[@]}"
+}
+
+src_configure() {
+	exportmakeopts
+}
+
+src_compile() {
+	git_emake
+
+	if use perl && use cgi ; then
+		git_emake gitweb
+	fi
+
+	if [[ ${CHOST} == *-darwin* ]] && tc-is-clang ; then
+		git_emake -C contrib/credential/osxkeychain
+	fi
+
+	pushd Documentation &>/dev/null || die
+	if [[ ${PV} == *9999 ]] ; then
+		git_emake man
+		if use doc ; then
+			git_emake info html
+		fi
+	else
+		if use doc ; then
+			git_emake info
+		fi
+	fi
+	popd &>/dev/null || die
+
+	if use gnome-keyring ; then
+		git_emake -C contrib/credential/libsecret
+	fi
+
+	pushd contrib/subtree &>/dev/null || die
+	git_emake git-subtree
+	# git-subtree.1 requires the full USE=doc dependency stack
+	use doc && git_emake git-subtree.html git-subtree.1
+	popd &>/dev/null || die
+
+	git_emake -C contrib/diff-highlight
+
+	if use mediawiki ; then
+		git_emake -C contrib/mw-to-git
+	fi
+}
+
+src_test() {
+	local disabled=(
+		# We make safe-directory optional
+		t0033-safe-directory.sh
+	)
+
+	local tests_cvs=(
+		t9200-git-cvsexportcommit.sh
+		t9400-git-cvsserver-server.sh
+		t9401-git-cvsserver-crlf.sh
+		t9402-git-cvsserver-refs.sh
+		t9600-cvsimport.sh
+		t9601-cvsimport-vendor-branch.sh
+		t9602-cvsimport-branches-tags.sh
+		t9603-cvsimport-patchsets.sh
+		t9604-cvsimport-timestamps.sh
+	)
+
+	local tests_perl=(
+		t3701-add-interactive.sh
+		t5502-quickfetch.sh
+		t5512-ls-remote.sh
+		t5520-pull.sh
+		t7106-reset-unborn-branch.sh
+		t7501-commit.sh
+	)
+	# Bug #225601 - t0004 is not suitable for root perm
+	# Bug #219839 - t1004 is not suitable for root perm
+	# t0001-init.sh - check for init notices EPERM*  fails
+	local tests_nonroot=(
+		t0001-init.sh
+		t0004-unwritable.sh
+		t0070-fundamental.sh
+		t1004-read-tree-m-u-wf.sh
+		t3700-add.sh
+		t7300-clean.sh
+	)
+	# t9100 still fails with symlinks in SVN 1.7
+	local test_svn=( t9100-git-svn-basic.sh )
+
+	# Unzip is used only for the testcase code, not by any normal parts of Git.
+	if ! has_version app-arch/unzip ; then
+		einfo "Disabling tar-tree tests"
+		disabled+=( t5000-tar-tree.sh )
+	fi
+
+	local cvs=0
+	use cvs && let cvs=${cvs}+1
+	if [[ ${EUID} -eq 0 ]] ; then
+		if [[ ${cvs} -eq 1 ]] ; then
+			ewarn "Skipping CVS tests because CVS does not work as root!"
+			ewarn "You should retest with FEATURES=userpriv!"
+			disabled+=( ${tests_cvs[@]} )
+		fi
+		einfo "Skipping other tests that require being non-root"
+		disabled+=( ${tests_nonroot[@]} )
+	else
+		if [[ ${cvs} -gt 0 ]] && has_version dev-vcs/cvs ; then
+			let cvs=${cvs}+1
+		fi
+
+		if [[ ${cvs} -gt 1 ]] && has_version "dev-vcs/cvs[server]" ; then
+			let cvs=${cvs}+1
+		fi
+
+		if [[ ${cvs} -lt 3 ]] ; then
+			einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
+			disabled+=( ${tests_cvs[@]} )
+		fi
+	fi
+
+	if ! use perl ; then
+		einfo "Disabling tests that need Perl"
+		disabled+=( ${tests_perl[@]} )
+	fi
+
+	einfo "Disabling tests that fail with SVN 1.7"
+	disabled+=( ${test_svn[@]} )
+
+	# Reset all previously disabled tests
+	pushd t &>/dev/null || die
+	local i
+	for i in *.sh.DISABLED ; do
+		[[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
+	done
+	einfo "Disabled tests:"
+	for i in ${disabled[@]} ; do
+		if [[ -f "${i}" ]] ; then
+			mv -f "${i}" "${i}.DISABLED" && einfo "Disabled ${i}"
+		fi
+	done
+
+	# Avoid the test system removing the results because we want them ourselves
+	sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' -i Makefile || die
+
+	# Clean old results first, must always run
+	nonfatal git_emake clean
+	popd &>/dev/null || die
+
+	# Now run the tests, keep going if we hit an error, and don't terminate on
+	# failure
+	local rc
+	einfo "Start test run"
+	#MAKEOPTS=-j1
+	nonfatal git_emake --keep-going test
+	rc=$?
+
+	# Display nice results, now print the results
+	pushd t &>/dev/null || die
+	nonfatal git_emake aggregate-results
+
+	# And bail if there was a problem
+	[[ ${rc} -eq 0 ]] || die "Tests failed. Please file a bug!"
+}
+
+src_install() {
+	git_emake DESTDIR="${D}" install
+
+	if [[ ${CHOST} == *-darwin* ]] && tc-is-clang ; then
+		dobin contrib/credential/osxkeychain/git-credential-osxkeychain
+	fi
+
+	# Depending on the tarball and manual rebuild of the documentation, the
+	# manpages may exist in either OR both of these directories.
+	find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
+	find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
+	dodoc README* Documentation/{SubmittingPatches,CodingGuidelines}
+	use doc && dodir /usr/share/doc/${PF}/html
+	local d
+	for d in / /howto/ /technical/ ; do
+		docinto ${d}
+		dodoc Documentation${d}*.txt
+		if use doc ; then
+			docinto ${d}/html
+			dodoc Documentation${d}*.html
+		fi
+	done
+	docinto /
+	# Upstream does not ship this pre-built :-(
+	use doc && doinfo Documentation/{git,gitman}.info
+
+	newbashcomp contrib/completion/git-completion.bash ${PN}
+	bashcomp_alias git gitk
+	# Not really a bash-completion file (bug #477920)
+	# but still needed uncompressed (bug #507480)
+	insinto /usr/share/${PN}
+	doins contrib/completion/git-prompt.sh
+
+	#dobin contrib/fast-import/git-p4 # Moved upstream
+	#dodoc contrib/fast-import/git-p4.txt # Moved upstream
+	newbin contrib/fast-import/import-tars.perl import-tars
+	exeinto /usr/libexec/git-core/
+	newexe contrib/git-resurrect.sh git-resurrect
+
+	# git-subtree
+	pushd contrib/subtree &>/dev/null || die
+	git_emake DESTDIR="${D}" install
+	if use doc ; then
+		# Do not move git subtree install-man outside USE=doc!
+		git_emake DESTDIR="${D}" install-man install-html
+	fi
+	newdoc README README.git-subtree
+	dodoc git-subtree.txt
+	popd &>/dev/null || die
+
+	if use mediawiki ; then
+		git_emake -C contrib/mw-to-git DESTDIR="${D}" install
+	fi
+
+	# diff-highlight
+	dobin contrib/diff-highlight/diff-highlight
+	newdoc contrib/diff-highlight/README README.diff-highlight
+
+	# git-jump
+	exeinto /usr/libexec/git-core/
+	doexe contrib/git-jump/git-jump
+	newdoc contrib/git-jump/README git-jump.txt
+
+	# git-contacts
+	exeinto /usr/libexec/git-core/
+	doexe contrib/contacts/git-contacts
+	dodoc contrib/contacts/git-contacts.txt
+
+	if use gnome-keyring ; then
+		pushd contrib/credential/libsecret &>/dev/null || die
+		dobin git-credential-libsecret
+		popd &>/dev/null || die
+	fi
+
+	dodir /usr/share/${PN}/contrib
+	# The following are excluded:
+	# completion - installed above
+	# diff-highlight - done above
+	# emacs - removed upstream
+	# examples - these are stuff that is not used in Git anymore actually
+	# git-jump - done above
+	# gitview - installed above
+	# p4import - excluded because fast-import has a better one
+	# patches - stuff the Git guys made to go upstream to other places
+	# persistent-https - TODO
+	# mw-to-git - TODO
+	# subtree - build  seperately
+	# svnimport - use git-svn
+	# thunderbird-patch-inline - fixes thunderbird
+	local contrib_objects=(
+		buildsystems
+		fast-import
+		hg-to-git
+		hooks
+		remotes2config.sh
+		rerere-train.sh
+		stats
+		workdir
+	)
+	local i
+	for i in "${contrib_objects[@]}" ; do
+		cp -rf "${S}"/contrib/${i} "${ED}"/usr/share/${PN}/contrib || die "Failed contrib ${i}"
+	done
+
+	if use perl && use cgi ; then
+		# We used to install in /usr/share/${PN}/gitweb
+		# but upstream installs in /usr/share/gitweb
+		# so we will install a symlink and use their location for compat with other
+		# distros
+		dosym ../gitweb /usr/share/${PN}/gitweb
+
+		# INSTALL discusses configuration issues, not just installation
+		docinto /
+		newdoc  "${S}"/gitweb/INSTALL INSTALL.gitweb
+		newdoc  "${S}"/gitweb/README README.gitweb
+
+		for d in "${ED}"/usr/lib{,64}/perl5/ ; do
+			if [[ -d "${d}" ]] ; then
+				find "${d}" -name .packlist -delete || die
+			fi
+		done
+	else
+		rm -rf "${ED}"/usr/share/gitweb
+	fi
+
+	if ! use subversion ; then
+		rm -f "${ED}"/usr/libexec/git-core/git-svn \
+			"${ED}"/usr/share/man/man1/git-svn.1*
+	fi
+
+	if use xinetd ; then
+		insinto /etc/xinetd.d
+		newins "${FILESDIR}"/git-daemon.xinetd git-daemon
+	fi
+
+	if ! use prefix ; then
+		newinitd "${FILESDIR}"/git-daemon-r2.initd git-daemon
+		newconfd "${FILESDIR}"/git-daemon.confd git-daemon
+		systemd_newunit "${FILESDIR}/git-daemon_at-r1.service" "git-daemon@.service"
+		systemd_dounit "${FILESDIR}/git-daemon.socket"
+	fi
+
+	perl_delete_localpod
+
+	# Remove disabled linguas
+	# we could remove sources in src_prepare, but install does not
+	# handle missing locale dir well
+	rm_loc() {
+		if [[ -e "${ED}/usr/share/locale/${1}" ]] ; then
+			rm -r "${ED}/usr/share/locale/${1}" || die
+		fi
+	}
+	plocale_for_each_disabled_locale rm_loc
+}
+
+pkg_postinst() {
+	if [[ -z ${REPLACING_VERSIONS} ]] ; then
+		elog "Please read /usr/share/bash-completion/completions/git for Git bash command"
+		elog "completion."
+		elog "Please read /usr/share/git/git-prompt.sh for Git bash prompt"
+		elog "Note that the prompt bash code is now in that separate script"
+	fi
+
+	optfeature_header "Some scripts require additional dependencies:"
+	optfeature git-quiltimport dev-util/quilt
+	optfeature git-instaweb www-servers/lighttpd www-servers/apache www-servers/nginx
+}
diff --git a/dev-vcs/git/git-2.40.1.ebuild b/dev-vcs/git/git-2.40.1.ebuild
new file mode 100644
index 000000000000..ce146cc61342
--- /dev/null
+++ b/dev-vcs/git/git-2.40.1.ebuild
@@ -0,0 +1,644 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+GENTOO_DEPEND_ON_PERL=no
+
+# bug #329479: git-remote-testgit is not multiple-version aware
+PYTHON_COMPAT=( python3_{9..11} )
+
+inherit toolchain-funcs perl-module bash-completion-r1 optfeature plocale python-single-r1 systemd
+
+PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
+
+if [[ ${PV} == *9999 ]]; then
+	EGIT_REPO_URI="https://git.kernel.org/pub/scm/git/git.git"
+
+	inherit git-r3
+	# Please ensure that all _four_ 9999 ebuilds get updated; they track the 4 upstream branches.
+	# See https://git-scm.com/docs/gitworkflows#_graduation
+	# In order of stability:
+	# 9999-r0: maint
+	# 9999-r1: master
+	# 9999-r2: next
+	# 9999-r3: seen
+	case ${PVR} in
+		9999) EGIT_BRANCH=maint ;;
+		9999-r1) EGIT_BRANCH=master ;;
+		9999-r2) EGIT_BRANCH=next;;
+		9999-r3) EGIT_BRANCH=seen ;;
+	esac
+fi
+
+MY_PV="${PV/_rc/.rc}"
+MY_P="${PN}-${MY_PV}"
+
+DOC_VER="${MY_PV}"
+
+DESCRIPTION="Stupid content tracker: distributed VCS designed for speed and efficiency"
+HOMEPAGE="https://www.git-scm.com/"
+
+if [[ ${PV} != *9999 ]]; then
+	SRC_URI_SUFFIX="xz"
+	SRC_URI_KORG="https://www.kernel.org/pub/software/scm/git"
+
+	[[ ${PV/rc} != ${PV} ]] && SRC_URI_KORG+='/testing'
+
+	SRC_URI="${SRC_URI_KORG}/${MY_P}.tar.${SRC_URI_SUFFIX}"
+	SRC_URI+=" ${SRC_URI_KORG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}"
+	SRC_URI+=" doc? ( ${SRC_URI_KORG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX} )"
+
+	if [[ ${PV} != *_rc* ]] ; then
+		KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+	fi
+fi
+
+S="${WORKDIR}"/${MY_P}
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="+blksha1 +curl cgi doc gnome-keyring +gpg highlight +iconv mediawiki +nls +pcre perforce +perl +safe-directory selinux subversion tk +webdav xinetd cvs test"
+
+# Common to both DEPEND and RDEPEND
+DEPEND="
+	dev-libs/openssl:=
+	sys-libs/zlib
+	curl? (
+		net-misc/curl
+		webdav? ( dev-libs/expat )
+	)
+	gnome-keyring? (
+		app-crypt/libsecret
+		dev-libs/glib:2
+	)
+	iconv? ( virtual/libiconv )
+	pcre? ( dev-libs/libpcre2:= )
+	perl? ( dev-lang/perl:=[-build(-)] )
+	tk? ( dev-lang/tk:= )
+"
+RDEPEND="
+	${DEPEND}
+	gpg? ( app-crypt/gnupg )
+	perl? (
+		dev-perl/Error
+		dev-perl/MailTools
+		dev-perl/Authen-SASL
+		>=virtual/perl-libnet-3.110.0-r4[ssl]
+		cgi? (
+			dev-perl/CGI
+			highlight? ( app-text/highlight )
+		)
+		cvs? (
+			>=dev-vcs/cvsps-2.1:0
+			dev-perl/DBI
+			dev-perl/DBD-SQLite
+		)
+		mediawiki? (
+			dev-perl/DateTime-Format-ISO8601
+			dev-perl/HTML-Tree
+			dev-perl/MediaWiki-API
+		)
+		subversion? (
+			dev-vcs/subversion[-dso(-),perl]
+			dev-perl/libwww-perl
+			dev-perl/TermReadKey
+		)
+	)
+	perforce? ( ${PYTHON_DEPS} )
+	selinux? ( sec-policy/selinux-git )
+"
+
+# This is how info docs are created with Git:
+#   .txt/asciidoc --(asciidoc)---------> .xml/docbook
+#   .xml/docbook  --(docbook2texi.pl)--> .texi
+#   .texi         --(makeinfo)---------> .info
+BDEPEND="
+	doc? (
+		app-text/asciidoc
+		app-text/docbook2X
+		app-text/xmlto
+		sys-apps/texinfo
+	)
+	gnome-keyring? ( virtual/pkgconfig )
+	nls? ( sys-devel/gettext )
+	test? (	app-crypt/gnupg	)
+"
+
+# Live ebuild builds man pages and HTML docs, additionally
+if [[ ${PV} == *9999 ]]; then
+	BDEPEND+=" app-text/asciidoc"
+fi
+
+SITEFILE="50${PN}-gentoo.el"
+
+REQUIRED_USE="
+	cgi? ( perl )
+	cvs? ( perl )
+	mediawiki? ( perl )
+	perforce? ( ${PYTHON_REQUIRED_USE} )
+	subversion? ( perl )
+	webdav? ( curl )
+"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	# Avoid automagic CVS, bug #350330
+	"${FILESDIR}"/git-2.37.0_rc1-optional-cvs.patch
+
+	# Make submodule output quiet
+	"${FILESDIR}"/git-2.21.0-quiet-submodules-testcase.patch
+)
+
+pkg_setup() {
+	if use subversion && has_version "dev-vcs/subversion[dso]" ; then
+		ewarn "Per Gentoo bugs #223747, #238586, when subversion is built"
+		ewarn "with USE=dso, there may be weird crashes in git-svn. You"
+		ewarn "have been warned!"
+	fi
+
+	if use perforce ; then
+		python-single-r1_pkg_setup
+	fi
+}
+
+# This is needed because for some obscure reasons future calls to make don't
+# pick up these exports if we export them in src_unpack()
+exportmakeopts() {
+	local extlibs myopts
+
+	myopts=(
+		ASCIIDOC_NO_ROFF=YesPlease
+
+		$(usex perl 'INSTALLDIRS=vendor NO_PERL_CPAN_FALLBACKS=YesPlease' NO_PERL=YesPlease)
+
+		$(usev elibc_musl NO_REGEX=NeedsStartEnd)
+		$(usev !cvs NO_CVS=YesPlease)
+		$(usev !iconv NO_ICONV=YesPlease)
+		$(usev !nls NO_GETTEXT=YesPlease)
+		$(usev !perforce NO_PYTHON=YesPlease)
+		$(usev !subversion NO_SVN_TESTS=YesPlease)
+		$(usev !tk NO_TCLTK=YesPlease)
+	)
+
+	if use blksha1 ; then
+		myopts+=( BLK_SHA1=YesPlease )
+	fi
+
+	if use curl ; then
+		use webdav || myopts+=( NO_EXPAT=YesPlease )
+	else
+		myopts+=( NO_CURL=YesPlease )
+	fi
+
+	# Broken assumptions because of static build system
+	myopts+=(
+		NO_FINK=YesPlease
+		NO_DARWIN_PORTS=YesPlease
+		INSTALL=install
+		TAR=tar
+		SHELL_PATH="${EPREFIX}/bin/sh"
+		SANE_TOOL_PATH=
+		OLD_ICONV=
+		NO_EXTERNAL_GREP=
+	)
+
+	# Can't define this to null, since the entire makefile depends on it
+	sed -i -e '/\/usr\/local/s/BASIC_/#BASIC_/' Makefile || die
+
+	if use pcre; then
+		myopts+=( USE_LIBPCRE2=YesPlease )
+		extlibs+=( -lpcre2-8 )
+	fi
+
+	if [[ ${CHOST} == *-solaris* ]]; then
+		myopts+=(
+			NEEDS_LIBICONV=YesPlease
+			HAVE_CLOCK_MONOTONIC=1
+		)
+
+		if grep -Fq getdelim "${ESYSROOT}"/usr/include/stdio.h ; then
+			myopts+=( HAVE_GETDELIM=1 )
+		fi
+	fi
+
+	myopts+=( ASCIIDOC8=YesPlease )
+
+	export MY_MAKEOPTS="${myopts[@]}"
+	export EXTLIBS="${extlibs[@]}"
+}
+
+src_unpack() {
+	if [[ ${PV} != *9999 ]] ; then
+		unpack ${MY_P}.tar.${SRC_URI_SUFFIX}
+
+		cd "${S}" || die
+		unpack ${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
+
+		if use doc ; then
+			pushd "${S}"/Documentation &>/dev/null || die
+			unpack ${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
+			popd &>/dev/null || die
+		fi
+	else
+		git-r3_src_unpack
+		#cp "${FILESDIR}"/GIT-VERSION-GEN . || die
+	fi
+
+}
+
+src_prepare() {
+	if ! use safe-directory ; then
+		# This patch neuters the "safe directory" detection.
+		# bugs #838271, #838223
+		PATCHES+=(
+			"${FILESDIR}"/git-2.37.2-unsafe-directory.patch
+		)
+	fi
+
+	default
+
+	if use prefix ; then
+		# bug #757309
+		eapply "${FILESDIR}"/git-2.37.2-darwin-prefix-gettext.patch
+	fi
+
+	sed -i \
+		-e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
+		-e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \
+		-e 's:^\(CC[[:space:]]* =\).*$:\1$(OPTCC):' \
+		-e 's:^\(AR[[:space:]]* =\).*$:\1$(OPTAR):' \
+		-e "s:\(PYTHON_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
+		-e "s:\(PERL_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
+		Makefile || die
+
+	# Fix docbook2texi command
+	sed -r -i 's/DOCBOOK2X_TEXI[[:space:]]*=[[:space:]]*docbook2x-texi/DOCBOOK2X_TEXI = docbook2texi.pl/' \
+		Documentation/Makefile || die
+}
+
+git_emake() {
+	# bug #320647: PYTHON_PATH
+	local PYTHON_PATH=""
+	use perforce && PYTHON_PATH="${PYTHON}"
+
+	local mymakeargs=(
+		${MY_MAKEOPTS}
+
+		prefix="${EPREFIX}"/usr
+		htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+		perllibdir="$(use perl && perl_get_raw_vendorlib)"
+		sysconfdir="${EPREFIX}"/etc
+
+		CC="$(tc-getCC)"
+		CFLAGS="${CFLAGS}"
+		PKG_CONFIG="$(tc-getPKG_CONFIG)"
+
+		# TODO: --verbose?
+		GIT_TEST_OPTS="--no-color"
+
+		OPTAR="$(tc-getAR)"
+		OPTCC="$(tc-getCC)"
+		OPTCFLAGS="${CFLAGS}"
+		OPTLDFLAGS="${LDFLAGS}"
+
+		PERL_PATH="${EPREFIX}/usr/bin/perl"
+		PERL_MM_OPT=""
+
+		PYTHON_PATH="${PYTHON_PATH}"
+
+		V=1
+		"$@"
+	)
+
+	emake "${mymakeargs[@]}"
+}
+
+src_configure() {
+	exportmakeopts
+}
+
+src_compile() {
+	git_emake
+
+	if use perl && use cgi ; then
+		git_emake gitweb
+	fi
+
+	if [[ ${CHOST} == *-darwin* ]] && tc-is-clang ; then
+		git_emake -C contrib/credential/osxkeychain
+	fi
+
+	pushd Documentation &>/dev/null || die
+	if [[ ${PV} == *9999 ]] ; then
+		git_emake man
+		if use doc ; then
+			git_emake info html
+		fi
+	else
+		if use doc ; then
+			git_emake info
+		fi
+	fi
+	popd &>/dev/null || die
+
+	if use gnome-keyring ; then
+		git_emake -C contrib/credential/libsecret
+	fi
+
+	pushd contrib/subtree &>/dev/null || die
+	git_emake git-subtree
+	# git-subtree.1 requires the full USE=doc dependency stack
+	use doc && git_emake git-subtree.html git-subtree.1
+	popd &>/dev/null || die
+
+	git_emake -C contrib/diff-highlight
+
+	if use mediawiki ; then
+		git_emake -C contrib/mw-to-git
+	fi
+}
+
+src_test() {
+	local disabled=(
+		# We make safe-directory optional
+		t0033-safe-directory.sh
+	)
+
+	local tests_cvs=(
+		t9200-git-cvsexportcommit.sh
+		t9400-git-cvsserver-server.sh
+		t9401-git-cvsserver-crlf.sh
+		t9402-git-cvsserver-refs.sh
+		t9600-cvsimport.sh
+		t9601-cvsimport-vendor-branch.sh
+		t9602-cvsimport-branches-tags.sh
+		t9603-cvsimport-patchsets.sh
+		t9604-cvsimport-timestamps.sh
+	)
+
+	local tests_perl=(
+		t3701-add-interactive.sh
+		t5502-quickfetch.sh
+		t5512-ls-remote.sh
+		t5520-pull.sh
+		t7106-reset-unborn-branch.sh
+		t7501-commit.sh
+	)
+	# Bug #225601 - t0004 is not suitable for root perm
+	# Bug #219839 - t1004 is not suitable for root perm
+	# t0001-init.sh - check for init notices EPERM*  fails
+	local tests_nonroot=(
+		t0001-init.sh
+		t0004-unwritable.sh
+		t0070-fundamental.sh
+		t1004-read-tree-m-u-wf.sh
+		t3700-add.sh
+		t7300-clean.sh
+	)
+	# t9100 still fails with symlinks in SVN 1.7
+	local test_svn=( t9100-git-svn-basic.sh )
+
+	# Unzip is used only for the testcase code, not by any normal parts of Git.
+	if ! has_version app-arch/unzip ; then
+		einfo "Disabling tar-tree tests"
+		disabled+=( t5000-tar-tree.sh )
+	fi
+
+	local cvs=0
+	use cvs && let cvs=${cvs}+1
+	if [[ ${EUID} -eq 0 ]] ; then
+		if [[ ${cvs} -eq 1 ]] ; then
+			ewarn "Skipping CVS tests because CVS does not work as root!"
+			ewarn "You should retest with FEATURES=userpriv!"
+			disabled+=( ${tests_cvs[@]} )
+		fi
+		einfo "Skipping other tests that require being non-root"
+		disabled+=( ${tests_nonroot[@]} )
+	else
+		if [[ ${cvs} -gt 0 ]] && has_version dev-vcs/cvs ; then
+			let cvs=${cvs}+1
+		fi
+
+		if [[ ${cvs} -gt 1 ]] && has_version "dev-vcs/cvs[server]" ; then
+			let cvs=${cvs}+1
+		fi
+
+		if [[ ${cvs} -lt 3 ]] ; then
+			einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
+			disabled+=( ${tests_cvs[@]} )
+		fi
+	fi
+
+	if ! use perl ; then
+		einfo "Disabling tests that need Perl"
+		disabled+=( ${tests_perl[@]} )
+	fi
+
+	einfo "Disabling tests that fail with SVN 1.7"
+	disabled+=( ${test_svn[@]} )
+
+	# Reset all previously disabled tests
+	pushd t &>/dev/null || die
+	local i
+	for i in *.sh.DISABLED ; do
+		[[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
+	done
+	einfo "Disabled tests:"
+	for i in ${disabled[@]} ; do
+		if [[ -f "${i}" ]] ; then
+			mv -f "${i}" "${i}.DISABLED" && einfo "Disabled ${i}"
+		fi
+	done
+
+	# Avoid the test system removing the results because we want them ourselves
+	sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' -i Makefile || die
+
+	# Clean old results first, must always run
+	nonfatal git_emake clean
+	popd &>/dev/null || die
+
+	# Now run the tests, keep going if we hit an error, and don't terminate on
+	# failure
+	local rc
+	einfo "Start test run"
+	#MAKEOPTS=-j1
+	nonfatal git_emake --keep-going test
+	rc=$?
+
+	# Display nice results, now print the results
+	pushd t &>/dev/null || die
+	nonfatal git_emake aggregate-results
+
+	# And bail if there was a problem
+	[[ ${rc} -eq 0 ]] || die "Tests failed. Please file a bug!"
+}
+
+src_install() {
+	git_emake DESTDIR="${D}" install
+
+	if [[ ${CHOST} == *-darwin* ]] && tc-is-clang ; then
+		dobin contrib/credential/osxkeychain/git-credential-osxkeychain
+	fi
+
+	# Depending on the tarball and manual rebuild of the documentation, the
+	# manpages may exist in either OR both of these directories.
+	find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
+	find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
+	dodoc README* Documentation/{SubmittingPatches,CodingGuidelines}
+	use doc && dodir /usr/share/doc/${PF}/html
+	local d
+	for d in / /howto/ /technical/ ; do
+		docinto ${d}
+		dodoc Documentation${d}*.txt
+		if use doc ; then
+			docinto ${d}/html
+			dodoc Documentation${d}*.html
+		fi
+	done
+	docinto /
+	# Upstream does not ship this pre-built :-(
+	use doc && doinfo Documentation/{git,gitman}.info
+
+	newbashcomp contrib/completion/git-completion.bash ${PN}
+	bashcomp_alias git gitk
+	# Not really a bash-completion file (bug #477920)
+	# but still needed uncompressed (bug #507480)
+	insinto /usr/share/${PN}
+	doins contrib/completion/git-prompt.sh
+
+	#dobin contrib/fast-import/git-p4 # Moved upstream
+	#dodoc contrib/fast-import/git-p4.txt # Moved upstream
+	newbin contrib/fast-import/import-tars.perl import-tars
+	exeinto /usr/libexec/git-core/
+	newexe contrib/git-resurrect.sh git-resurrect
+
+	# git-subtree
+	pushd contrib/subtree &>/dev/null || die
+	git_emake DESTDIR="${D}" install
+	if use doc ; then
+		# Do not move git subtree install-man outside USE=doc!
+		git_emake DESTDIR="${D}" install-man install-html
+	fi
+	newdoc README README.git-subtree
+	dodoc git-subtree.txt
+	popd &>/dev/null || die
+
+	if use mediawiki ; then
+		git_emake -C contrib/mw-to-git DESTDIR="${D}" install
+	fi
+
+	# diff-highlight
+	dobin contrib/diff-highlight/diff-highlight
+	newdoc contrib/diff-highlight/README README.diff-highlight
+
+	# git-jump
+	exeinto /usr/libexec/git-core/
+	doexe contrib/git-jump/git-jump
+	newdoc contrib/git-jump/README git-jump.txt
+
+	# git-contacts
+	exeinto /usr/libexec/git-core/
+	doexe contrib/contacts/git-contacts
+	dodoc contrib/contacts/git-contacts.txt
+
+	if use gnome-keyring ; then
+		pushd contrib/credential/libsecret &>/dev/null || die
+		dobin git-credential-libsecret
+		popd &>/dev/null || die
+	fi
+
+	dodir /usr/share/${PN}/contrib
+	# The following are excluded:
+	# completion - installed above
+	# diff-highlight - done above
+	# emacs - removed upstream
+	# examples - these are stuff that is not used in Git anymore actually
+	# git-jump - done above
+	# gitview - installed above
+	# p4import - excluded because fast-import has a better one
+	# patches - stuff the Git guys made to go upstream to other places
+	# persistent-https - TODO
+	# mw-to-git - TODO
+	# subtree - build  seperately
+	# svnimport - use git-svn
+	# thunderbird-patch-inline - fixes thunderbird
+	local contrib_objects=(
+		buildsystems
+		fast-import
+		hg-to-git
+		hooks
+		remotes2config.sh
+		rerere-train.sh
+		stats
+		workdir
+	)
+	local i
+	for i in "${contrib_objects[@]}" ; do
+		cp -rf "${S}"/contrib/${i} "${ED}"/usr/share/${PN}/contrib || die "Failed contrib ${i}"
+	done
+
+	if use perl && use cgi ; then
+		# We used to install in /usr/share/${PN}/gitweb
+		# but upstream installs in /usr/share/gitweb
+		# so we will install a symlink and use their location for compat with other
+		# distros
+		dosym ../gitweb /usr/share/${PN}/gitweb
+
+		# INSTALL discusses configuration issues, not just installation
+		docinto /
+		newdoc  "${S}"/gitweb/INSTALL INSTALL.gitweb
+		newdoc  "${S}"/gitweb/README README.gitweb
+
+		for d in "${ED}"/usr/lib{,64}/perl5/ ; do
+			if [[ -d "${d}" ]] ; then
+				find "${d}" -name .packlist -delete || die
+			fi
+		done
+	else
+		rm -rf "${ED}"/usr/share/gitweb
+	fi
+
+	if ! use subversion ; then
+		rm -f "${ED}"/usr/libexec/git-core/git-svn \
+			"${ED}"/usr/share/man/man1/git-svn.1*
+	fi
+
+	if use xinetd ; then
+		insinto /etc/xinetd.d
+		newins "${FILESDIR}"/git-daemon.xinetd git-daemon
+	fi
+
+	if ! use prefix ; then
+		newinitd "${FILESDIR}"/git-daemon-r2.initd git-daemon
+		newconfd "${FILESDIR}"/git-daemon.confd git-daemon
+		systemd_newunit "${FILESDIR}/git-daemon_at-r1.service" "git-daemon@.service"
+		systemd_dounit "${FILESDIR}/git-daemon.socket"
+	fi
+
+	perl_delete_localpod
+
+	# Remove disabled linguas
+	# we could remove sources in src_prepare, but install does not
+	# handle missing locale dir well
+	rm_loc() {
+		if [[ -e "${ED}/usr/share/locale/${1}" ]] ; then
+			rm -r "${ED}/usr/share/locale/${1}" || die
+		fi
+	}
+	plocale_for_each_disabled_locale rm_loc
+}
+
+pkg_postinst() {
+	if [[ -z ${REPLACING_VERSIONS} ]] ; then
+		elog "Please read /usr/share/bash-completion/completions/git for Git bash command"
+		elog "completion."
+		elog "Please read /usr/share/git/git-prompt.sh for Git bash prompt"
+		elog "Note that the prompt bash code is now in that separate script"
+	fi
+
+	optfeature_header "Some scripts require additional dependencies:"
+	optfeature git-quiltimport dev-util/quilt
+	optfeature git-instaweb www-servers/lighttpd www-servers/apache www-servers/nginx
+}
diff --git a/dev-vcs/pre-commit/Manifest b/dev-vcs/pre-commit/Manifest
index a13fd6916a43..8e8adc8ff6c6 100644
--- a/dev-vcs/pre-commit/Manifest
+++ b/dev-vcs/pre-commit/Manifest
@@ -5,5 +5,5 @@ DIST pre-commit-3.2.1.gh.tar.gz 267233 BLAKE2B 39843fa9f7529ee38670b3c7ebea1e29b
 DIST pre-commit-3.2.2.gh.tar.gz 267269 BLAKE2B b3b245b2ac0f0f4012e2612515e376aaaf5b4de0b5494c02a2b38b1b9b8584ae3fa7d9ee482ee19bbf6eb5ac1d5f9ec187e44c4bb7bb6046488b178628af850e SHA512 bf2602508425482e57c2e1b1ca2b36085560fa0e51e5d559b6c715a0534f182897eb54831a17a60a713cea0301a7521bb75c03881e8cb8527fbc565259a23ddf
 EBUILD pre-commit-3.0.4.ebuild 1711 BLAKE2B 3c1f5768aedd958ed6a9ccbb9396076084255f645e7339cc04b73d3fd4e976f4b1562a405125a40c941bb02adfde3e1926700e45c1fd29d2fcda55aa64a41645 SHA512 8790c810a8dfb7fd489536e45ba148c22e106c8cdb6641cd7a936124a3777e907163ad801b0252707273320505dbb9233161d3a5d7fd60e6c2b1fe0d434e1c01
 EBUILD pre-commit-3.2.1.ebuild 1728 BLAKE2B e55f817324e23771d2d3d9ae8ea2bda01819844b55928ceba829afd6e21dd4f975b9c31ff2cdcba1ab4e087d5dd8ee31ecb08d6c3337f8968d592a89bf207269 SHA512 a9bbb524938132e475c4d74084c7f1527406d6c732a32e212ed672d9a3eee2ef907ad4bf6cc9989c14e6dffa55653f301fd4325768f9cb528f53d9108c10adb4
-EBUILD pre-commit-3.2.2.ebuild 1728 BLAKE2B e55f817324e23771d2d3d9ae8ea2bda01819844b55928ceba829afd6e21dd4f975b9c31ff2cdcba1ab4e087d5dd8ee31ecb08d6c3337f8968d592a89bf207269 SHA512 a9bbb524938132e475c4d74084c7f1527406d6c732a32e212ed672d9a3eee2ef907ad4bf6cc9989c14e6dffa55653f301fd4325768f9cb528f53d9108c10adb4
+EBUILD pre-commit-3.2.2.ebuild 1735 BLAKE2B 39245136fb1d109190e66ff30b33d5de3b370fde1f955b9520b555e2c592df5276e2eb1cc7b7107d6154a3ee02ef4ae18fa74041aba45eb0dc587a05f291b327 SHA512 1a2bd2a70252d35ab0671e7209ad108b980ac7edcaeceeaa1c8c3786b08738b3c0ead8c0d3f9a4c6136a82ee7a41c3881d8d0316aceb586d0d42b02e4306deda
 MISC metadata.xml 380 BLAKE2B 99842a97367e91700c6f714f427b7b3d4b7212c401abae5ab715dfaa724776f02fe250184a33504d3433bb58cd5679af59a32ec21a7e7432481160dab36a4d95 SHA512 45330930d1e58fc1de0fd0ba55cd488dee96579ceab3be5073b91ff8f4f2b9adefff533dbfa5b0e8b23fbb648d45c0b7b4073a1ec57b586600cc2bf6347e0bbb
diff --git a/dev-vcs/pre-commit/pre-commit-3.2.2.ebuild b/dev-vcs/pre-commit/pre-commit-3.2.2.ebuild
index 5f06fdcab423..017446fb29d3 100644
--- a/dev-vcs/pre-commit/pre-commit-3.2.2.ebuild
+++ b/dev-vcs/pre-commit/pre-commit-3.2.2.ebuild
@@ -16,7 +16,7 @@ SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.
 
 LICENSE="MIT"
 SLOT="0"
-KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86"
+KEYWORDS="~amd64 ~arm64 ~hppa ~ppc ~ppc64 ~x86"
 
 RDEPEND="dev-vcs/git
 	$(python_gen_cond_dep '
diff --git a/dev-vcs/tortoisehg/Manifest b/dev-vcs/tortoisehg/Manifest
index 1f816793cf11..9427e7fce7d0 100644
--- a/dev-vcs/tortoisehg/Manifest
+++ b/dev-vcs/tortoisehg/Manifest
@@ -1,6 +1,8 @@
 DIST tortoisehg-6.2.3.tar.gz 8878641 BLAKE2B ede267f48c7b58db1fcdf16a11fb343e4fcf21193a43f6d6114ef6f930946beea458acc52780deaa889d429989c7b8b25045a9ed340297c0d1ee7e5e5e998d2a SHA512 8c7e62822bdbdcae7a371b910e3e549864019b3a74a090e59d0f26291525ebda078de3f41d8442b457e14727ec94143290d0f3fac9f49cbe842d1de298ae2edd
 DIST tortoisehg-6.3.2.tar.gz 8885325 BLAKE2B bb9a7043f7d2e44b32e20b6dd88372927977a6fd94b662a8a56d26776c72268e0953de3edc93b2f7b9efc580286632f500f5181a5ef7bf3edd3fb5ba5ec64761 SHA512 b711f9d347b2f00978b42b258713d365188c4de100668a09fea4b6f80bb8083a7980a462b8fb4705d31f9da310dbdeb2d9891e93f6e3f6f2833e4c7ccfa4d800
+DIST tortoisehg-6.4.2.tar.gz 8854453 BLAKE2B 04c57de8ea745cdcd33fe8a65b95f76937b59f01486eec6f305eed52dceaed898d55b95769de8a4f41606a3dda6d81e44d3eb1690ee6dde7ab21526b2a46032d SHA512 efe23a991130423aa374e7dd5fe051fabcc6d48c3596a355c7d21dfa35de062411cf2edc3efe4800146c6b3ab4dbd064da54a4f27988297cfd6dc1f69ab14e22
 EBUILD tortoisehg-6.2.3.ebuild 2286 BLAKE2B 28dc72c911cb1574f9872f857b14a086532fa4b10e10690c20b42acd7724f5572f75a2ef1ffd8d2d96d589af055da69c94fb2ecc63dd947cbc26465fc903441b SHA512 6a62ff1e3f2af96dc688cef53a1a0021acfbceb94f531fa39931c99dec979b21d9ce08a539717902b2642a5bfac269c90486d701592ab6ff13388f8ee8cc6b62
 EBUILD tortoisehg-6.3.2.ebuild 2369 BLAKE2B 33f0a33cb8e0407cd98fbf6f005c31f06122f3fd0f173a122b02c4a1784da79c9c828db6885081329bd63148220b31209e738545474f2e82c8f3f94e3f113388 SHA512 0f3820a1fe27bc4e97f1ef229ce51b7f6026779593e6ead79593c512c2a576b2392ea51434f092012345affc5c0fdf99933c3eb9617414c0980f6a222b2e37b0
-EBUILD tortoisehg-9999.ebuild 2371 BLAKE2B 492fd50ac3c8b7d3bf4c67c5951f8006ce5b2bd10b75cddeece424b04384cc64398bcb41b1572d42e7125c43b78c380e0dcc69d44b61eb92f370317bca3beb7b SHA512 2e347aade2daed3f0b26124517d15bedc9004b3913c9a19aac15ef0a27a0d731abab4f3cc4e3d5579f34ab9165538aefc70341e66fec117177025bc7dcc0067f
+EBUILD tortoisehg-6.4.2.ebuild 2371 BLAKE2B eca66ff4f1d05ac1bd36c5851ea43f8f5c4cd6843b04d6fc1c3d26682ee9b250a6a964f50bf11512cc4051e8917ff3a7b48830eb984409ad53f5679c84c84122 SHA512 f3ba92581ed1be3c07a2b88737cc68c707f480b8a747939749fa12d2841008eea2871073ee1a553c2ff4e3b599cbdb3933f3fc5bec3400de216303a9441146e8
+EBUILD tortoisehg-9999.ebuild 2371 BLAKE2B eca66ff4f1d05ac1bd36c5851ea43f8f5c4cd6843b04d6fc1c3d26682ee9b250a6a964f50bf11512cc4051e8917ff3a7b48830eb984409ad53f5679c84c84122 SHA512 f3ba92581ed1be3c07a2b88737cc68c707f480b8a747939749fa12d2841008eea2871073ee1a553c2ff4e3b599cbdb3933f3fc5bec3400de216303a9441146e8
 MISC metadata.xml 805 BLAKE2B b09f8454c68278c180c84a62c54410909d731307058fcfb973d48b304269ae4eac6d4e61d4f04857813659029869097e3ba5a4d2bb6fea698797b364ba588cbe SHA512 33aa011e53112a7e1589205bf563fefb3db2cc931f4643a03abfc6baafd1b57c59a4f712814dfd3e3e1eb6b299fb34af53bcb2d1c08accaed6989f23b3e41acc
diff --git a/dev-vcs/tortoisehg/tortoisehg-6.4.2.ebuild b/dev-vcs/tortoisehg/tortoisehg-6.4.2.ebuild
new file mode 100644
index 000000000000..7222b381f779
--- /dev/null
+++ b/dev-vcs/tortoisehg/tortoisehg-6.4.2.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+DISTUTILS_USE_PEP517=setuptools
+
+inherit desktop distutils-r1 optfeature xdg-utils
+
+if [[ ${PV} != *9999* ]]; then
+	KEYWORDS="~amd64 ~arm64 ~x86"
+	SRC_URI="https://foss.heptapod.net/mercurial/${PN}/thg/-/archive/${PV}/thg-${PV}.tar.gz -> ${P}.tar.gz"
+	HG_DEPEND=">=dev-vcs/mercurial-6.2[${PYTHON_USEDEP}]
+		$(python_gen_cond_dep '>=dev-vcs/mercurial-6.3.2[${PYTHON_USEDEP}]' python3_11 )
+		<dev-vcs/mercurial-6.5[${PYTHON_USEDEP}]"
+	S="${WORKDIR}/thg-${PV}"
+else
+	inherit mercurial
+	EHG_REPO_URI="https://foss.heptapod.net/mercurial/${PN}/thg"
+	EHG_REVISION="stable"
+	HG_DEPEND=">=dev-vcs/mercurial-6.2[${PYTHON_USEDEP}]"
+fi
+
+DESCRIPTION="Set of graphical tools for Mercurial"
+HOMEPAGE="https://tortoisehg.bitbucket.io/"
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	${HG_DEPEND}
+	dev-python/iniparse[${PYTHON_USEDEP}]
+	dev-python/pygments[${PYTHON_USEDEP}]
+	dev-python/PyQt5[network,svg,${PYTHON_USEDEP}]
+	>=dev-python/qscintilla-python-2.11.6[qt5(+),${PYTHON_USEDEP}]
+"
+BDEPEND="
+	${RDEPEND}
+	test? (
+		dev-python/mock[${PYTHON_USEDEP}]
+		dev-python/pytest[${PYTHON_USEDEP}]
+	)
+"
+
+distutils_enable_sphinx doc/source
+
+python_prepare_all() {
+	# Remove file that collides with >=mercurial-4.0 (bug #599266).
+	rm "${S}"/hgext3rd/__init__.py || die "can't remove /hgext3rd/__init__.py"
+
+	sed -i -e 's:share/doc/tortoisehg:share/doc/'"${PF}"':' setup.py || die
+	distutils-r1_python_prepare_all
+}
+
+python_test() {
+	${EPYTHON} tests/run-tests.py -m 'not largefiles' --disable-pytest-warnings --doctest-modules tests || die "Tests failed with ${EPYTHON}"
+	${EPYTHON} tests/run-tests.py -m largefiles --disable-pytest-warnings tests || die "Tests failed with ${EPYTHON}"
+}
+
+python_install_all() {
+	distutils-r1_python_install_all
+	dodoc doc/ReadMe*.txt doc/TODO contrib/mergetools.rc
+	newicon -s scalable icons/scalable/apps/thg.svg thg_logo.svg
+	domenu contrib/thg.desktop
+}
+
+pkg_postinst() {
+	xdg_icon_cache_update
+	elog "When startup of ${PN} fails with an API version mismatch error"
+	elog "between dev-python/sip and dev-python/PyQt5 please rebuild"
+	elog "dev-python/qscintilla-python."
+
+	optfeature "the core git extension support" dev-python/pygit2
+}
+
+pkg_postrm() {
+	xdg_icon_cache_update
+}
diff --git a/dev-vcs/tortoisehg/tortoisehg-9999.ebuild b/dev-vcs/tortoisehg/tortoisehg-9999.ebuild
index b14e5b79045a..7222b381f779 100644
--- a/dev-vcs/tortoisehg/tortoisehg-9999.ebuild
+++ b/dev-vcs/tortoisehg/tortoisehg-9999.ebuild
@@ -11,15 +11,15 @@ inherit desktop distutils-r1 optfeature xdg-utils
 if [[ ${PV} != *9999* ]]; then
 	KEYWORDS="~amd64 ~arm64 ~x86"
 	SRC_URI="https://foss.heptapod.net/mercurial/${PN}/thg/-/archive/${PV}/thg-${PV}.tar.gz -> ${P}.tar.gz"
-	HG_DEPEND=">=dev-vcs/mercurial-5.9[${PYTHON_USEDEP}]
+	HG_DEPEND=">=dev-vcs/mercurial-6.2[${PYTHON_USEDEP}]
 		$(python_gen_cond_dep '>=dev-vcs/mercurial-6.3.2[${PYTHON_USEDEP}]' python3_11 )
-		<dev-vcs/mercurial-6.4[${PYTHON_USEDEP}]"
+		<dev-vcs/mercurial-6.5[${PYTHON_USEDEP}]"
 	S="${WORKDIR}/thg-${PV}"
 else
 	inherit mercurial
 	EHG_REPO_URI="https://foss.heptapod.net/mercurial/${PN}/thg"
 	EHG_REVISION="stable"
-	HG_DEPEND=">=dev-vcs/mercurial-5.9[${PYTHON_USEDEP}]"
+	HG_DEPEND=">=dev-vcs/mercurial-6.2[${PYTHON_USEDEP}]"
 fi
 
 DESCRIPTION="Set of graphical tools for Mercurial"
-- 
cgit v1.2.3