comparison mercurial/dispatch.py @ 14886:9a3831d64ae2

dispatch: move shell alias handling after early arg handling --cwd, --repo, and --config obviously should be handled first
author Matt Mackall <mpm@selenic.com>
date Fri, 15 Jul 2011 16:06:53 -0500
parents ad6a58581ecd
children d6ba373c9a8f
comparison
equal deleted inserted replaced
14885:50b67d5c4073 14886:9a3831d64ae2
524 _loaded = set() 524 _loaded = set()
525 def _dispatch(req): 525 def _dispatch(req):
526 args = req.args 526 args = req.args
527 ui = req.ui 527 ui = req.ui
528 528
529 shellaliasfn = _checkshellalias(ui, args)
530 if shellaliasfn:
531 return shellaliasfn()
532
533 # read --config before doing anything else 529 # read --config before doing anything else
534 # (e.g. to change trust settings for reading .hg/hgrc) 530 # (e.g. to change trust settings for reading .hg/hgrc)
535 cfgs = _parseconfig(ui, _earlygetopt(['--config'], args)) 531 cfgs = _parseconfig(ui, _earlygetopt(['--config'], args))
536 532
537 # check for cwd 533 # check for cwd
539 if cwd: 535 if cwd:
540 os.chdir(cwd[-1]) 536 os.chdir(cwd[-1])
541 537
542 rpath = _earlygetopt(["-R", "--repository", "--repo"], args) 538 rpath = _earlygetopt(["-R", "--repository", "--repo"], args)
543 path, lui = _getlocal(ui, rpath) 539 path, lui = _getlocal(ui, rpath)
540
541 # Now that we're operating in the right directory/repository with
542 # the right config settings, check for shell aliases
543 shellaliasfn = _checkshellalias(ui, args)
544 if shellaliasfn:
545 return shellaliasfn()
544 546
545 # Configure extensions in phases: uisetup, extsetup, cmdtable, and 547 # Configure extensions in phases: uisetup, extsetup, cmdtable, and
546 # reposetup. Programs like TortoiseHg will call _dispatch several 548 # reposetup. Programs like TortoiseHg will call _dispatch several
547 # times so we keep track of configured extensions in _loaded. 549 # times so we keep track of configured extensions in _loaded.
548 extensions.loadall(lui) 550 extensions.loadall(lui)