Mercurial > hg
comparison mercurial/ui.py @ 9610:d78fe60f6bda
make path expanding more consistent
This expands ~user and $FOO constructs in ui.ignore files, [defaults],
[paths], extension paths, and HGRCPATH files.
author | Alexander Solovyov <piranha@piranha.org.ua> |
---|---|
date | Mon, 19 Oct 2009 22:19:28 +0300 |
parents | 96379c93ba6f |
children | c63c336ee2f7 |
comparison
equal
deleted
inserted
replaced
9609:aa404f3f661b | 9610:d78fe60f6bda |
---|---|
196 if not self.verbose: user = util.shortuser(user) | 196 if not self.verbose: user = util.shortuser(user) |
197 return user | 197 return user |
198 | 198 |
199 def _path(self, loc): | 199 def _path(self, loc): |
200 p = self.config('paths', loc) | 200 p = self.config('paths', loc) |
201 if p and '%%' in p: | 201 if p: |
202 self.warn("(deprecated '%%' in path %s=%s from %s)\n" % | 202 if '%%' in p: |
203 (loc, p, self.configsource('paths', loc))) | 203 self.warn("(deprecated '%%' in path %s=%s from %s)\n" % |
204 p = p.replace('%%', '%') | 204 (loc, p, self.configsource('paths', loc))) |
205 p = p.replace('%%', '%') | |
206 p = util.expandpath(p) | |
205 return p | 207 return p |
206 | 208 |
207 def expandpath(self, loc, default=None): | 209 def expandpath(self, loc, default=None): |
208 """Return repository location relative to cwd or from [paths]""" | 210 """Return repository location relative to cwd or from [paths]""" |
209 if "://" in loc or os.path.isdir(os.path.join(loc, '.hg')): | 211 if "://" in loc or os.path.isdir(os.path.join(loc, '.hg')): |