merge with main
authorThomas Arendsen Hein <thomas@intevation.de>
Thu, 14 Jun 2007 11:33:32 +0200
changeset 4582 7de7a80e7422
parent 4581 4500fbe3a432 (current diff)
parent 4560 3daed3680554 (diff)
child 4583 11cf78983961
child 4584 0d26e3d0eeeb
merge with main
mercurial/extensions.py
mercurial/localrepo.py
--- 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