--- a/mercurial/extensions.py Wed Jun 13 19:11:20 2007 -0700
+++ b/mercurial/extensions.py Thu Jun 14 11:33:32 2007 +0200
@@ -17,8 +17,8 @@
return _extensions[name]
except KeyError:
for k, v in _extensions.iteritems():
- if k.endswith('.' + name) or k.endswith('/' + name) or v == name:
- return sys.modules[v]
+ if k.endswith('.' + name) or k.endswith('/' + name):
+ return v
raise KeyError(name)
def load(ui, name, path):
--- a/mercurial/localrepo.py Wed Jun 13 19:11:20 2007 -0700
+++ b/mercurial/localrepo.py Thu Jun 14 11:33:32 2007 +0200
@@ -79,10 +79,6 @@
except IOError:
pass
- self.changelog = changelog.changelog(self.sopener)
- self.sopener.defversion = self.changelog.version
- self.manifest = manifest.manifest(self.sopener)
-
fallback = self.ui.config('ui', 'fallbackencoding')
if fallback:
util._fallbackencoding = fallback
@@ -93,7 +89,20 @@
self.filterpats = {}
self.transhandle = None
- self.dirstate = dirstate.dirstate(self.opener, self.ui, self.root)
+ def __getattr__(self, name):
+ if name == 'changelog':
+ self.changelog = changelog.changelog(self.sopener)
+ self.sopener.defversion = self.changelog.version
+ return self.changelog
+ if name == 'manifest':
+ self.changelog
+ self.manifest = manifest.manifest(self.sopener)
+ return self.manifest
+ if name == 'dirstate':
+ self.dirstate = dirstate.dirstate(self.opener, self.ui, self.root)
+ return self.dirstate
+ else:
+ raise AttributeError, name
def url(self):
return 'file:' + self.root