urlutil: drop the deprecated `getpath()`
authorMatt Harbison <matt_harbison@yahoo.com>
Tue, 03 Jan 2023 11:53:35 -0500
changeset 49926 a9602a84a442
parent 49925 b7f33ed1d909
child 49927 e0c0545e2e55
urlutil: drop the deprecated `getpath()` This was deprecated in 5.9.
mercurial/utils/urlutil.py
--- 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 = {}