##// END OF EJS Templates
dispatch: propagate ui command options to the local ui (issue2523)...
Idan Kamara -
r14601:25c1f3dd default
parent child Browse files
Show More
@@ -572,16 +572,20 b' def _dispatch(req):'
572 atexit.register(print_time)
572 atexit.register(print_time)
573
573
574 if options['verbose'] or options['debug'] or options['quiet']:
574 if options['verbose'] or options['debug'] or options['quiet']:
575 ui.setconfig('ui', 'verbose', str(bool(options['verbose'])))
575 for ui in (ui, lui):
576 ui.setconfig('ui', 'debug', str(bool(options['debug'])))
576 ui.setconfig('ui', 'verbose', str(bool(options['verbose'])))
577 ui.setconfig('ui', 'quiet', str(bool(options['quiet'])))
577 ui.setconfig('ui', 'debug', str(bool(options['debug'])))
578 ui.setconfig('ui', 'quiet', str(bool(options['quiet'])))
578 if options['traceback']:
579 if options['traceback']:
579 ui.setconfig('ui', 'traceback', 'on')
580 for ui in (ui, lui):
581 ui.setconfig('ui', 'traceback', 'on')
580 if options['noninteractive']:
582 if options['noninteractive']:
581 ui.setconfig('ui', 'interactive', 'off')
583 for ui in (ui, lui):
584 ui.setconfig('ui', 'interactive', 'off')
582
585
583 if cmdoptions.get('insecure', False):
586 if cmdoptions.get('insecure', False):
584 ui.setconfig('web', 'cacerts', '')
587 for ui in (ui, lui):
588 ui.setconfig('web', 'cacerts', '')
585
589
586 if options['help']:
590 if options['help']:
587 return commands.help_(ui, cmd, options['version'])
591 return commands.help_(ui, cmd, options['version'])
@@ -346,6 +346,9 b' preoutgoing hook can prevent outgoing ch'
346 > def brokenhook(**args):
346 > def brokenhook(**args):
347 > return 1 + {}
347 > return 1 + {}
348 >
348 >
349 > def verbosehook(ui, **args):
350 > ui.note('verbose output from hook\n')
351 >
349 > class container:
352 > class container:
350 > unreachable = 1
353 > unreachable = 1
351 > EOF
354 > EOF
@@ -535,3 +538,14 b' commit and update hooks should run after'
535 cb9a9f314b8b
538 cb9a9f314b8b
536 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
539 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
537
540
541 make sure --verbose (and --quiet/--debug etc.) are propogated to the local ui
542 that is passed to pre/post hooks
543
544 $ echo '[hooks]' > .hg/hgrc
545 $ echo 'pre-identify = python:hooktests.verbosehook' >> .hg/hgrc
546 $ hg id
547 cb9a9f314b8b
548 $ hg id --verbose
549 calling hook pre-identify: hooktests.verbosehook
550 verbose output from hook
551 cb9a9f314b8b
General Comments 0
You need to be logged in to leave comments. Login now