comparison hgext/chgserver.py @ 28767:73bfd9a54a5c

chgserver: move args copying logic to the correct place A previous patch moved it to an incorrect place. Since dispatch._earlygetopt has side effects on args, we need to move it to the place before _earlygetopt.
author Jun Wu <quark@fb.com>
date Mon, 04 Apr 2016 01:10:51 +0100
parents f467073cd798
children 2461f33c9f97
comparison
equal deleted inserted replaced
28766:7f7cd44cd6d5 28767:73bfd9a54a5c
277 # internal config: extensions.chgserver 277 # internal config: extensions.chgserver
278 newui.setconfig('extensions', 'chgserver', 278 newui.setconfig('extensions', 'chgserver',
279 srcui.config('extensions', 'chgserver'), '--config') 279 srcui.config('extensions', 'chgserver'), '--config')
280 280
281 # command line args 281 # command line args
282 args = args[:]
282 dispatch._parseconfig(newui, dispatch._earlygetopt(['--config'], args)) 283 dispatch._parseconfig(newui, dispatch._earlygetopt(['--config'], args))
283 284
284 # stolen from tortoisehg.util.copydynamicconfig() 285 # stolen from tortoisehg.util.copydynamicconfig()
285 for section, name, value in srcui.walkconfig(): 286 for section, name, value in srcui.walkconfig():
286 source = srcui.configsource(section, name) 287 source = srcui.configsource(section, name)
291 # ui.configsource returns 'none' by default 292 # ui.configsource returns 'none' by default
292 source = '' 293 source = ''
293 newui.setconfig(section, name, value, source) 294 newui.setconfig(section, name, value, source)
294 295
295 # load wd and repo config, copied from dispatch.py 296 # load wd and repo config, copied from dispatch.py
296 args = args[:]
297 cwds = dispatch._earlygetopt(['--cwd'], args) 297 cwds = dispatch._earlygetopt(['--cwd'], args)
298 cwd = cwds and os.path.realpath(cwds[-1]) or None 298 cwd = cwds and os.path.realpath(cwds[-1]) or None
299 rpath = dispatch._earlygetopt(["-R", "--repository", "--repo"], args) 299 rpath = dispatch._earlygetopt(["-R", "--repository", "--repo"], args)
300 path, newlui = dispatch._getlocal(newui, rpath, wd=cwd) 300 path, newlui = dispatch._getlocal(newui, rpath, wd=cwd)
301 301