##// END OF EJS Templates
ui: fix-up and warn about deprecated %%
Matt Mackall -
r8196:b7c85a80 default
parent child Browse files
Show More
@@ -226,14 +226,22 b' class ui(object):'
226 if not self.verbose: user = util.shortuser(user)
226 if not self.verbose: user = util.shortuser(user)
227 return user
227 return user
228
228
229 def _path(self, loc):
230 p = self.config('paths', loc)
231 if p and '%%' in p:
232 ui.warn('(deprecated \'\%\%\' in path %s=%s from %s)\n' %
233 (loc, p, self.configsource('paths', loc)))
234 return p.replace('%%', '%')
235 return p
236
229 def expandpath(self, loc, default=None):
237 def expandpath(self, loc, default=None):
230 """Return repository location relative to cwd or from [paths]"""
238 """Return repository location relative to cwd or from [paths]"""
231 if "://" in loc or os.path.isdir(os.path.join(loc, '.hg')):
239 if "://" in loc or os.path.isdir(os.path.join(loc, '.hg')):
232 return loc
240 return loc
233
241
234 path = self.config("paths", loc)
242 path = self._path(loc)
235 if not path and default is not None:
243 if not path and default is not None:
236 path = self.config("paths", default)
244 path = self._path(default)
237 return path or loc
245 return path or loc
238
246
239 def pushbuffer(self):
247 def pushbuffer(self):
General Comments 0
You need to be logged in to leave comments. Login now