changeset 4582:7de7a80e7422

merge with main
author Thomas Arendsen Hein <thomas@intevation.de>
date Thu, 14 Jun 2007 11:33:32 +0200
parents 4500fbe3a432 (current diff) 3daed3680554 (diff)
children 11cf78983961 0d26e3d0eeeb
files mercurial/extensions.py mercurial/localrepo.py
diffstat 2 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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