Mercurial > public > mercurial-scm > hg
comparison mercurial/extensions.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 | 1c83938b6a8e |
children | e0eae93e6c67 |
comparison
equal
deleted
inserted
replaced
9609:aa404f3f661b | 9610:d78fe60f6bda |
---|---|
28 return v | 28 return v |
29 raise KeyError(name) | 29 raise KeyError(name) |
30 | 30 |
31 def loadpath(path, module_name): | 31 def loadpath(path, module_name): |
32 module_name = module_name.replace('.', '_') | 32 module_name = module_name.replace('.', '_') |
33 path = os.path.expanduser(path) | 33 path = util.expandpath(path) |
34 if os.path.isdir(path): | 34 if os.path.isdir(path): |
35 # module/__init__.py style | 35 # module/__init__.py style |
36 d, f = os.path.split(path.rstrip('/')) | 36 d, f = os.path.split(path.rstrip('/')) |
37 fd, fpath, desc = imp.find_module(f, [d]) | 37 fd, fpath, desc = imp.find_module(f, [d]) |
38 return imp.load_module(module_name, fd, fpath, desc) | 38 return imp.load_module(module_name, fd, fpath, desc) |