# HG changeset patch # User Andrii Verbytskyi # Date 2024-06-13 12:46:12 # Node ID 8cfec191e01afbd04bdbf2fef5f599c1f050b911 # Parent 35680f5159b0c85ca46b1e20540822c307ca9f97 chore(deps): bumped mercurial to 6.7.4, hg-evolve to 11.1.3, fixed related issues diff --git a/requirements.txt b/requirements.txt --- a/requirements.txt +++ b/requirements.txt @@ -31,10 +31,10 @@ dulwich==0.21.6 urllib3==1.26.14 gunicorn==21.2.0 packaging==24.0 -hg-evolve==11.0.2 +hg-evolve==11.1.3 importlib-metadata==6.0.0 zipp==3.15.0 -mercurial==6.3.3 +mercurial==6.7.4 more-itertools==9.1.0 msgpack==1.0.8 orjson==3.10.3 diff --git a/vcsserver/hgcompat.py b/vcsserver/hgcompat.py --- a/vcsserver/hgcompat.py +++ b/vcsserver/hgcompat.py @@ -56,7 +56,7 @@ from mercurial.node import bin, hex from mercurial.encoding import tolocal from mercurial.discovery import findcommonoutgoing from mercurial.hg import peer -from mercurial.httppeer import makepeer +from mercurial.httppeer import make_peer from mercurial.utils.urlutil import url as hg_url from mercurial.scmutil import revrange, revsymbol from mercurial.node import nullrev diff --git a/vcsserver/remote/hg_remote.py b/vcsserver/remote/hg_remote.py --- a/vcsserver/remote/hg_remote.py +++ b/vcsserver/remote/hg_remote.py @@ -31,6 +31,7 @@ from mercurial import unionrepo from mercurial import verify from mercurial import repair from mercurial.error import AmbiguousPrefixLookupError +from mercurial.utils.urlutil import path as hg_path import vcsserver from vcsserver import exceptions @@ -54,7 +55,7 @@ from vcsserver.hgcompat import ( hg_url as url_parser, httpbasicauthhandler, httpdigestauthhandler, - makepeer, + make_peer, instance, match, memctx, @@ -521,8 +522,10 @@ class HgRemote(RemoteBase): # check for pure hg repos log.debug( "Verifying if URL is a Mercurial repository: %s", obfuscated_uri) + # Create repo path with custom mercurial path object ui = make_ui_from_config(config) - peer_checker = makepeer(ui, safe_bytes(url)) + repo_path = hg_path(ui=ui, rawloc=safe_bytes(test_uri)) + peer_checker = make_peer(ui, repo_path, False) peer_checker.lookup(b'tip') except Exception as e: log.warning("URL is not a valid Mercurial repository: %s", @@ -1038,7 +1041,7 @@ class HgRemote(RemoteBase): # Mercurial internally has a lot of logic that checks ONLY if # option is defined, we just pass those if they are defined then - opts = {} + opts = {"remote_hidden": False} if bookmark: opts['bookmark'] = [safe_bytes(x) for x in bookmark] \