##// END OF EJS Templates
dispatch: move shell alias handling after early arg handling...
Matt Mackall -
r14886:9a3831d6 default
parent child Browse files
Show More
@@ -526,10 +526,6 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))
@@ -542,6 +538,12 def _dispatch(req):
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)
544
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()
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.
@@ -251,7 +251,7 shell aliases with global options
251 $ hg --cwd .. count 'branch(default)'
251 $ hg --cwd .. count 'branch(default)'
252 2
252 2
253 $ hg echo --cwd ..
253 $ hg echo --cwd ..
254 --cwd ..
254
255
255
256
256
257 repo specific shell aliases
257 repo specific shell aliases
@@ -274,8 +274,6 shell alias defined in current repo
274 hg: unknown command 'subalias'
274 hg: unknown command 'subalias'
275 [255]
275 [255]
276 $ hg -R .. subalias > /dev/null
276 $ hg -R .. subalias > /dev/null
277 hg: unknown command 'subalias'
278 [255]
279
277
280
278
281 shell alias defined in other repo
279 shell alias defined in other repo
@@ -284,6 +282,7 shell alias defined in other repo
284 hg: unknown command 'mainalias'
282 hg: unknown command 'mainalias'
285 [255]
283 [255]
286 $ hg -R .. mainalias
284 $ hg -R .. mainalias
285 warning: --repository ignored
287 main
286 main
288 $ hg --cwd .. mainalias
287 $ hg --cwd .. mainalias
289 main
288 main
General Comments 0
You need to be logged in to leave comments. Login now