Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/hgwebdir_mod.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 | 80df04266a16 |
children | f1c9fafcbf46 |
comparison
equal
deleted
inserted
replaced
30557:cbeb54ec0481 | 30559:d83ca854fa21 |
---|---|
134 return | 134 return |
135 | 135 |
136 if self.baseui: | 136 if self.baseui: |
137 u = self.baseui.copy() | 137 u = self.baseui.copy() |
138 else: | 138 else: |
139 u = uimod.ui() | 139 u = uimod.ui.load() |
140 u.setconfig('ui', 'report_untrusted', 'off', 'hgwebdir') | 140 u.setconfig('ui', 'report_untrusted', 'off', 'hgwebdir') |
141 u.setconfig('ui', 'nontty', 'true', 'hgwebdir') | 141 u.setconfig('ui', 'nontty', 'true', 'hgwebdir') |
142 # displaying bundling progress bar while serving feels wrong and may | 142 # displaying bundling progress bar while serving feels wrong and may |
143 # break some wsgi implementations. | 143 # break some wsgi implementations. |
144 u.setconfig('progress', 'disable', 'true', 'hgweb') | 144 u.setconfig('progress', 'disable', 'true', 'hgweb') |