comparison mercurial/ui.py @ 49837:dcf983a5f906

ui: drop the deprecated `expandpath()` This was deprecated since 5.8.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 03 Jan 2023 11:48:21 -0500
parents de284a0b5614
children b7f33ed1d909
comparison
equal deleted inserted replaced
49828:9854a9adc466 49837:dcf983a5f906
1096 def shortuser(self, user: bytes) -> bytes: 1096 def shortuser(self, user: bytes) -> bytes:
1097 """Return a short representation of a user name or email address.""" 1097 """Return a short representation of a user name or email address."""
1098 if not self.verbose: 1098 if not self.verbose:
1099 user = stringutil.shortuser(user) 1099 user = stringutil.shortuser(user)
1100 return user 1100 return user
1101
1102 def expandpath(self, loc, default=None):
1103 """Return repository location relative to cwd or from [paths]"""
1104 msg = b'ui.expandpath is deprecated, use `get_*` functions from urlutil'
1105 self.deprecwarn(msg, b'6.0')
1106 try:
1107 p = self.getpath(loc)
1108 if p:
1109 return p.rawloc
1110 except error.RepoError:
1111 pass
1112
1113 if default:
1114 try:
1115 p = self.getpath(default)
1116 if p:
1117 return p.rawloc
1118 except error.RepoError:
1119 pass
1120
1121 return loc
1122 1101
1123 @util.propertycache 1102 @util.propertycache
1124 def paths(self): 1103 def paths(self):
1125 return urlutil.paths(self) 1104 return urlutil.paths(self)
1126 1105