Patchwork D10439: urlutil: deprecate `getpath`

login
register
mail settings
Submitter phabricator
Date April 15, 2021, 8:53 a.m.
Message ID <differential-rev-PHID-DREV-67msxut6syevnbfephtk-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48756/
State Superseded
Headers show

Comments

phabricator - April 15, 2021, 8:53 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  There as no remaining user of that function.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10439

AFFECTED FILES
  mercurial/ui.py
  mercurial/utils/urlutil.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/utils/urlutil.py b/mercurial/utils/urlutil.py
--- a/mercurial/utils/urlutil.py
+++ b/mercurial/utils/urlutil.py
@@ -610,6 +610,8 @@ 
         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'
+        self.deprecwarn(msg, '6.0')
         # Only fall back to default if no path was requested.
         if name is None:
             if not default:
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1058,6 +1058,8 @@ 
 
         This method exist as `getpath` need a ui for potential warning message.
         """
+        msg = b'ui.getpath is deprecated, use `get_*` functions from urlutil'
+        self.deprecwarn(msg, '6.0')
         return self.paths.getpath(self, *args, **kwargs)
 
     @property