# HG changeset patch # User Franz Glasner # Date 1661628976 -7200 # Node ID 2a062f87f75d6fb6fbecfefd109acdeba9c60a73 # Parent bee0d90267200409670fbcbfa2633ab9d4fa9835 Make "revinfo" and "kwarchive" work on Mercurial 6. Some URL related utility function have been moved from within mercurial.util to mercurial.utils.urlutil. diff -r bee0d9026720 -r 2a062f87f75d extensions/kwarchive.py --- a/extensions/kwarchive.py Sat Aug 27 18:13:04 2022 +0200 +++ b/extensions/kwarchive.py Sat Aug 27 21:36:16 2022 +0200 @@ -115,8 +115,14 @@ except ImportError: _dateutil = util + # some URL specific util functions moved to new mercurial.utils.urlutil + try: + from mercurial.utils import urlutil as _urlutil + except ImportError: + _urlutil = util -testedwith = b"4.3.1 4.3.2 4.4.1 4.4.2 4.5.2 4.6.1 4.8.1 4.9 5.0.1 5.1.2 5.2.1 5.5 5.6 5.9.1" + +testedwith = b"4.3.1 4.3.2 4.4.1 4.4.2 4.5.2 4.6.1 4.8.1 4.9 5.0.1 5.1.2 5.2.1 5.5 5.6 5.9.1 6.1.4" SHORTENED_HG_SCHEMES = { b"ssh": b"hg+ssh", @@ -709,16 +715,16 @@ hglocation = locations.loc try: if path_filter == b"full": - path_uri = bytes(util.url(hglocation)) + path_uri = bytes(_urlutil.url(hglocation)) elif path_filter == b"nopwd": - path_uri = util.hidepassword(hglocation) + path_uri = _urlutil.hidepassword(hglocation) elif path_filter == b"nouser": - path_url = util.url(hglocation) + path_url = _urlutil.url(hglocation) path_url.user = None path_url.passwd = None path_uri = bytes(path_url) elif path_filter == b"short": - path_url = util.url(hglocation) + path_url = _urlutil.url(hglocation) path_url.scheme = SHORTENED_HG_SCHEMES.get(path_url.scheme, b"hg") path_url.user = None @@ -727,7 +733,7 @@ path_url.port = None path_uri = bytes(path_url) elif path_filter == b"last": - path_url = str(util.url(hglocation)).split('/') + path_url = str(_urlutil.url(hglocation)).split('/') path_uri = pycompat.sysbytes(".../"+path_url[-1]) else: raise error.Abort(b"path-filter `%s' not implemented" diff -r bee0d9026720 -r 2a062f87f75d extensions/revinfo.py --- a/extensions/revinfo.py Sat Aug 27 18:13:04 2022 +0200 +++ b/extensions/revinfo.py Sat Aug 27 21:36:16 2022 +0200 @@ -21,7 +21,7 @@ from mercurial.i18n import _ -from mercurial import (cmdutil, scmutil, util, error, archival, pycompat, +from mercurial import (cmdutil, scmutil, error, archival, pycompat, util, demandimport) with demandimport.deactivated(): try: @@ -29,8 +29,14 @@ except ImportError: registrar = None + # some URL specific util functions moved to new mercurial.utils.urlutil + try: + from mercurial.utils import urlutil as _urlutil + except ImportError: + _urlutil = util -testedwith = b"4.3.1 4.3.2 4.4.1 4.4.2 4.5.2 4.6.1 4.8.1 4.9 5.0.1 5.1.2 5.2.1 5.5 5.6 5.9.1" + +testedwith = b"4.3.1 4.3.2 4.4.1 4.4.2 4.5.2 4.6.1 4.8.1 4.9 5.0.1 5.1.2 5.2.1 5.5 5.6 5.9.1 6.1.4" cmdtable = {} @@ -143,7 +149,7 @@ # for now a quick check of assumptions assert len(paths) == 1 if name == canonicalpath: - msg += b"path: %s\n" % util.hidepassword(paths[0].loc) + msg += b"path: %s\n" % _urlutil.hidepassword(paths[0].loc) break else: msg += b"path: %s\n" % canonicalpath