Mercurial > hg
view mercurial/demandload.py @ 1625:e1bcf7fa983f
correct the relative path when walking from a subdir
- yield the correct relative path when walking from a subdir
(regardless the walk is repo-wide or not)
- have a consistent output from all commands: filename are
absolute when no patterns are specified and relative otherwise.
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Tue, 17 Jan 2006 16:10:22 +0100 |
parents | 3db700146536 |
children | f3abe0bdccdd |
line wrap: on
line source
def demandload(scope, modules): class d: def __getattr__(self, name): mod = self.__dict__["mod"] scope = self.__dict__["scope"] scope[mod] = __import__(mod, scope, scope, []) return getattr(scope[mod], name) for m in modules.split(): dl = d() dl.mod = m dl.scope = scope scope[m] = dl