Mercurial > public > mercurial-scm > hg
comparison mercurial/dispatch.py @ 30559:d83ca854fa21
ui: factor out ui.load() to create a ui without loading configs (API)
This allows us to write doctests depending on a ui object, but not on global
configs.
ui.load() is a class method so we can do wsgiui.load(). All ui() calls but
for doctests are replaced with ui.load(). Some of them could be changed to
not load configs later.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 22 Oct 2016 14:35:10 +0900 |
parents | 4338f87dbf6f |
children | 541949a10a68 |
comparison
equal
deleted
inserted
replaced
30557:cbeb54ec0481 | 30559:d83ca854fa21 |
---|---|
99 else: | 99 else: |
100 ferr = util.stderr | 100 ferr = util.stderr |
101 | 101 |
102 try: | 102 try: |
103 if not req.ui: | 103 if not req.ui: |
104 req.ui = uimod.ui() | 104 req.ui = uimod.ui.load() |
105 if '--traceback' in req.args: | 105 if '--traceback' in req.args: |
106 req.ui.setconfig('ui', 'traceback', 'on', '--traceback') | 106 req.ui.setconfig('ui', 'traceback', 'on', '--traceback') |
107 | 107 |
108 # set ui streams from the request | 108 # set ui streams from the request |
109 if req.fin: | 109 if req.fin: |