Show More
@@ -180,17 +180,35 def _newchgui(srcui, csystem): | |||
|
180 | 180 | |
|
181 | 181 | return chgui(srcui) |
|
182 | 182 | |
|
183 | def _renewui(srcui): | |
|
183 | def _renewui(srcui, args=None): | |
|
184 | if not args: | |
|
185 | args = [] | |
|
186 | ||
|
184 | 187 | newui = srcui.__class__() |
|
185 | 188 | for a in ['fin', 'fout', 'ferr', 'environ']: |
|
186 | 189 | setattr(newui, a, getattr(srcui, a)) |
|
187 | 190 | if util.safehasattr(srcui, '_csystem'): |
|
188 | 191 | newui._csystem = srcui._csystem |
|
192 | ||
|
193 | # load wd and repo config, copied from dispatch.py | |
|
194 | cwds = dispatch._earlygetopt(['--cwd'], args) | |
|
195 | cwd = cwds and os.path.realpath(cwds[-1]) or None | |
|
196 | rpath = dispatch._earlygetopt(["-R", "--repository", "--repo"], args) | |
|
197 | path, newui = dispatch._getlocal(newui, rpath, wd=cwd) | |
|
198 | ||
|
199 | # internal config: extensions.chgserver | |
|
200 | # copy it. it can only be overrided from command line. | |
|
201 | newui.setconfig('extensions', 'chgserver', | |
|
202 | srcui.config('extensions', 'chgserver'), '--config') | |
|
203 | ||
|
204 | # command line args | |
|
205 | dispatch._parseconfig(newui, dispatch._earlygetopt(['--config'], args)) | |
|
206 | ||
|
189 | 207 | # stolen from tortoisehg.util.copydynamicconfig() |
|
190 | 208 | for section, name, value in srcui.walkconfig(): |
|
191 | 209 | source = srcui.configsource(section, name) |
|
192 | if ':' in source: | |
|
193 | # path:line | |
|
210 | if ':' in source or source == '--config': | |
|
211 | # path:line or command line | |
|
194 | 212 | continue |
|
195 | 213 | if source == 'none': |
|
196 | 214 | # ui.configsource returns 'none' by default |
General Comments 0
You need to be logged in to leave comments.
Login now