Mercurial > hg
changeset 49839:a9602a84a442
urlutil: drop the deprecated `getpath()`
This was deprecated in 5.9.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 03 Jan 2023 11:53:35 -0500 |
parents | b7f33ed1d909 |
children | e0c0545e2e55 |
files | mercurial/utils/urlutil.py |
diffstat | 1 files changed, 0 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/utils/urlutil.py Tue Jan 03 11:51:56 2023 -0500 +++ b/mercurial/utils/urlutil.py Tue Jan 03 11:53:35 2023 -0500 @@ -656,43 +656,6 @@ new_paths.extend(_chain_path(p, ui, self)) self[name] = new_paths - def getpath(self, ui, name, default=None): - """Return a ``path`` from a string, falling back to default. - - ``name`` can be a named path or locations. Locations are filesystem - paths or URIs. - - Returns None if ``name`` is not a registered path, a URI, or a local - path to a repo. - """ - msg = b'getpath is deprecated, use `get_*` functions from urlutil' - ui.deprecwarn(msg, b'6.0') - # Only fall back to default if no path was requested. - if name is None: - if not default: - default = () - elif not isinstance(default, (tuple, list)): - default = (default,) - for k in default: - try: - return self[k][0] - except KeyError: - continue - return None - - # Most likely empty string. - # This may need to raise in the future. - if not name: - return None - if name in self: - return self[name][0] - else: - # Try to resolve as a local path or URI. - path = try_path(ui, name) - if path is None: - raise error.RepoError(_(b'repository %s does not exist') % name) - return path.rawloc - _pathsuboptions = {}