Show More
@@ -267,7 +267,7 b' def _newchgui(srcui, csystem):' | |||||
267 |
|
267 | |||
268 | return chgui(srcui) |
|
268 | return chgui(srcui) | |
269 |
|
269 | |||
270 |
def _ |
|
270 | def _loadnewui(srcui, args=None): | |
271 | if not args: |
|
271 | if not args: | |
272 | args = [] |
|
272 | args = [] | |
273 |
|
273 | |||
@@ -277,14 +277,7 b' def _renewui(srcui, args=None):' | |||||
277 | if util.safehasattr(srcui, '_csystem'): |
|
277 | if util.safehasattr(srcui, '_csystem'): | |
278 | newui._csystem = srcui._csystem |
|
278 | newui._csystem = srcui._csystem | |
279 |
|
279 | |||
280 | # load wd and repo config, copied from dispatch.py |
|
|||
281 | cwds = dispatch._earlygetopt(['--cwd'], args) |
|
|||
282 | cwd = cwds and os.path.realpath(cwds[-1]) or None |
|
|||
283 | rpath = dispatch._earlygetopt(["-R", "--repository", "--repo"], args) |
|
|||
284 | path, newui = dispatch._getlocal(newui, rpath, wd=cwd) |
|
|||
285 |
|
||||
286 | # internal config: extensions.chgserver |
|
280 | # internal config: extensions.chgserver | |
287 | # copy it. it can only be overrided from command line. |
|
|||
288 | newui.setconfig('extensions', 'chgserver', |
|
281 | newui.setconfig('extensions', 'chgserver', | |
289 | srcui.config('extensions', 'chgserver'), '--config') |
|
282 | srcui.config('extensions', 'chgserver'), '--config') | |
290 |
|
283 | |||
@@ -301,7 +294,15 b' def _renewui(srcui, args=None):' | |||||
301 | # ui.configsource returns 'none' by default |
|
294 | # ui.configsource returns 'none' by default | |
302 | source = '' |
|
295 | source = '' | |
303 | newui.setconfig(section, name, value, source) |
|
296 | newui.setconfig(section, name, value, source) | |
304 | return newui |
|
297 | ||
|
298 | # load wd and repo config, copied from dispatch.py | |||
|
299 | args = args[:] | |||
|
300 | cwds = dispatch._earlygetopt(['--cwd'], args) | |||
|
301 | cwd = cwds and os.path.realpath(cwds[-1]) or None | |||
|
302 | rpath = dispatch._earlygetopt(["-R", "--repository", "--repo"], args) | |||
|
303 | path, newlui = dispatch._getlocal(newui, rpath, wd=cwd) | |||
|
304 | ||||
|
305 | return (newui, newlui) | |||
305 |
|
306 | |||
306 | class channeledsystem(object): |
|
307 | class channeledsystem(object): | |
307 | """Propagate ui.system() request in the following format: |
|
308 | """Propagate ui.system() request in the following format: | |
@@ -450,13 +451,13 b' class chgcmdserver(commandserver.server)' | |||||
450 | """ |
|
451 | """ | |
451 | args = self._readlist() |
|
452 | args = self._readlist() | |
452 | try: |
|
453 | try: | |
453 |
self.ui = _ |
|
454 | self.ui, lui = _loadnewui(self.ui, args) | |
454 | except error.ParseError as inst: |
|
455 | except error.ParseError as inst: | |
455 | dispatch._formatparse(self.ui.warn, inst) |
|
456 | dispatch._formatparse(self.ui.warn, inst) | |
456 | self.ui.flush() |
|
457 | self.ui.flush() | |
457 | self.cresult.write('exit 255') |
|
458 | self.cresult.write('exit 255') | |
458 | return |
|
459 | return | |
459 |
newhash = hashstate.fromui( |
|
460 | newhash = hashstate.fromui(lui, self.hashstate.mtimepaths) | |
460 | insts = [] |
|
461 | insts = [] | |
461 | if newhash.mtimehash != self.hashstate.mtimehash: |
|
462 | if newhash.mtimehash != self.hashstate.mtimehash: | |
462 | addr = _hashaddress(self.baseaddress, self.hashstate.confighash) |
|
463 | addr = _hashaddress(self.baseaddress, self.hashstate.confighash) | |
@@ -533,7 +534,7 b' class chgcmdserver(commandserver.server)' | |||||
533 |
|
534 | |||
534 | if set(['HGPLAIN', 'HGPLAINEXCEPT']) & diffkeys: |
|
535 | if set(['HGPLAIN', 'HGPLAINEXCEPT']) & diffkeys: | |
535 | # reload config so that ui.plain() takes effect |
|
536 | # reload config so that ui.plain() takes effect | |
536 |
self.ui = _ |
|
537 | self.ui, _lui = _loadnewui(self.ui) | |
537 |
|
538 | |||
538 | _clearenvaliases(commands.table) |
|
539 | _clearenvaliases(commands.table) | |
539 |
|
540 |
General Comments 0
You need to be logged in to leave comments.
Login now