comparison mercurial/localrepo.py @ 4559:eda59019dc69

localrepo: demand-load changeset, manifest, and dirstate
author Matt Mackall <mpm@selenic.com>
date Wed, 13 Jun 2007 13:15:51 -0500
parents 30bc57094bfc
children 7de7a80e7422
comparison
equal deleted inserted replaced
4558:9338be783398 4559:eda59019dc69
77 try: 77 try:
78 self.ui.readconfig(self.join("hgrc"), self.root) 78 self.ui.readconfig(self.join("hgrc"), self.root)
79 except IOError: 79 except IOError:
80 pass 80 pass
81 81
82 self.changelog = changelog.changelog(self.sopener)
83 self.sopener.defversion = self.changelog.version
84 self.manifest = manifest.manifest(self.sopener)
85
86 fallback = self.ui.config('ui', 'fallbackencoding') 82 fallback = self.ui.config('ui', 'fallbackencoding')
87 if fallback: 83 if fallback:
88 util._fallbackencoding = fallback 84 util._fallbackencoding = fallback
89 85
90 self.tagscache = None 86 self.tagscache = None
91 self.branchcache = None 87 self.branchcache = None
92 self.nodetagscache = None 88 self.nodetagscache = None
93 self.filterpats = {} 89 self.filterpats = {}
94 self.transhandle = None 90 self.transhandle = None
95 91
96 self.dirstate = dirstate.dirstate(self.opener, self.ui, self.root) 92 def __getattr__(self, name):
93 if name == 'changelog':
94 self.changelog = changelog.changelog(self.sopener)
95 self.sopener.defversion = self.changelog.version
96 return self.changelog
97 if name == 'manifest':
98 self.changelog
99 self.manifest = manifest.manifest(self.sopener)
100 return self.manifest
101 if name == 'dirstate':
102 self.dirstate = dirstate.dirstate(self.opener, self.ui, self.root)
103 return self.dirstate
104 else:
105 raise AttributeError, name
97 106
98 def url(self): 107 def url(self):
99 return 'file:' + self.root 108 return 'file:' + self.root
100 109
101 def hook(self, name, throw=False, **args): 110 def hook(self, name, throw=False, **args):