Mercurial > hgrepos > DevTools > mercurial-extensions
changeset 425:2a062f87f75d
Make "revinfo" and "kwarchive" work on Mercurial 6.
Some URL related utility function have been moved from within mercurial.util
to mercurial.utils.urlutil.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sat, 27 Aug 2022 21:36:16 +0200 |
| parents | bee0d9026720 |
| children | bf24f3199629 |
| files | extensions/kwarchive.py extensions/revinfo.py |
| diffstat | 2 files changed, 21 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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"
--- 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
