##// END OF EJS Templates
encoding: pull fallbackencoding out of localrepo into early parsing
Matt Mackall -
r4619:5fd7cc89 default
parent child Browse files
Show More
@@ -261,20 +261,24 b' def dispatch(ui, args):'
261 if cwd:
261 if cwd:
262 os.chdir(cwd)
262 os.chdir(cwd)
263
263
264 extensions.loadall(ui)
265
266 # read the local repository .hgrc into a local ui object
264 # read the local repository .hgrc into a local ui object
267 # this will trigger its extensions to load
265 # this will trigger its extensions to load
268 path = earlygetopt(["-R", "--repository", "--repo"], args)
266 path = earlygetopt(["-R", "--repository", "--repo"], args)
269 if not path:
267 if not path:
270 path = findrepo() or ""
268 path = findrepo() or ""
269 lui = ui
271 if path:
270 if path:
272 try:
271 try:
273 lui = commands.ui.ui(parentui=ui)
272 lui = commands.ui.ui(parentui=ui)
274 lui.readconfig(os.path.join(path, ".hg", "hgrc"))
273 lui.readconfig(os.path.join(path, ".hg", "hgrc"))
275 extensions.loadall(lui)
276 except IOError:
274 except IOError:
277 extensions.loadall(ui)
275 pass
276
277 extensions.loadall(lui)
278 # check for fallback encoding
279 fallback = lui.config('ui', 'fallbackencoding')
280 if fallback:
281 util._fallbackencoding = fallback
278
282
279 cmd, func, args, options, cmdoptions = parse(ui, args)
283 cmd, func, args, options, cmdoptions = parse(ui, args)
280
284
@@ -80,10 +80,6 b' class localrepository(repo.repository):'
80 except IOError:
80 except IOError:
81 pass
81 pass
82
82
83 fallback = self.ui.config('ui', 'fallbackencoding')
84 if fallback:
85 util._fallbackencoding = fallback
86
87 self.tagscache = None
83 self.tagscache = None
88 self.branchcache = None
84 self.branchcache = None
89 self.nodetagscache = None
85 self.nodetagscache = None
@@ -1,5 +1,5 b''
1 uisetup called
1 uisetup called
2 ui.parentui is None
2 ui.parentui isnot None
3 reposetup called for a
3 reposetup called for a
4 ui == repo.ui
4 ui == repo.ui
5 Foo
5 Foo
@@ -15,7 +15,7 b' ui.parentui is None'
15 Bar
15 Bar
16 % module/__init__.py-style
16 % module/__init__.py-style
17 uisetup called
17 uisetup called
18 ui.parentui is None
18 ui.parentui isnot None
19 reposetup called for a
19 reposetup called for a
20 ui == repo.ui
20 ui == repo.ui
21 Foo
21 Foo
General Comments 0
You need to be logged in to leave comments. Login now