102 |
102 |
103 if req.repo: |
103 if req.repo: |
104 # copy configs that were passed on the cmdline (--config) to |
104 # copy configs that were passed on the cmdline (--config) to |
105 # the repo ui |
105 # the repo ui |
106 for cfg in cfgs: |
106 for cfg in cfgs: |
107 req.repo.ui.setconfig(*cfg) |
107 req.repo.ui.setconfig(*cfg, source='--config') |
108 |
108 |
109 # if we are in HGPLAIN mode, then disable custom debugging |
109 # if we are in HGPLAIN mode, then disable custom debugging |
110 debugger = ui.config("ui", "debugger") |
110 debugger = ui.config("ui", "debugger") |
111 if not debugger or ui.plain(): |
111 if not debugger or ui.plain(): |
112 debugger = 'pdb' |
112 debugger = 'pdb' |
516 try: |
516 try: |
517 name, value = cfg.split('=', 1) |
517 name, value = cfg.split('=', 1) |
518 section, name = name.split('.', 1) |
518 section, name = name.split('.', 1) |
519 if not section or not name: |
519 if not section or not name: |
520 raise IndexError |
520 raise IndexError |
521 ui.setconfig(section, name, value) |
521 ui.setconfig(section, name, value, '--config') |
522 configs.append((section, name, value)) |
522 configs.append((section, name, value)) |
523 except (IndexError, ValueError): |
523 except (IndexError, ValueError): |
524 raise util.Abort(_('malformed --config option: %r ' |
524 raise util.Abort(_('malformed --config option: %r ' |
525 '(use --config section.name=value)') % cfg) |
525 '(use --config section.name=value)') % cfg) |
526 |
526 |
733 |
733 |
734 if options['verbose'] or options['debug'] or options['quiet']: |
734 if options['verbose'] or options['debug'] or options['quiet']: |
735 for opt in ('verbose', 'debug', 'quiet'): |
735 for opt in ('verbose', 'debug', 'quiet'): |
736 val = str(bool(options[opt])) |
736 val = str(bool(options[opt])) |
737 for ui_ in uis: |
737 for ui_ in uis: |
738 ui_.setconfig('ui', opt, val) |
738 ui_.setconfig('ui', opt, val, '--' + opt) |
739 |
739 |
740 if options['traceback']: |
740 if options['traceback']: |
741 for ui_ in uis: |
741 for ui_ in uis: |
742 ui_.setconfig('ui', 'traceback', 'on') |
742 ui_.setconfig('ui', 'traceback', 'on', '--traceback') |
743 |
743 |
744 if options['noninteractive']: |
744 if options['noninteractive']: |
745 for ui_ in uis: |
745 for ui_ in uis: |
746 ui_.setconfig('ui', 'interactive', 'off') |
746 ui_.setconfig('ui', 'interactive', 'off', '-y') |
747 |
747 |
748 if cmdoptions.get('insecure', False): |
748 if cmdoptions.get('insecure', False): |
749 for ui_ in uis: |
749 for ui_ in uis: |
750 ui_.setconfig('web', 'cacerts', '') |
750 ui_.setconfig('web', 'cacerts', '', '--insecure') |
751 |
751 |
752 if options['version']: |
752 if options['version']: |
753 return commands.version_(ui) |
753 return commands.version_(ui) |
754 if options['help']: |
754 if options['help']: |
755 return commands.help_(ui, cmd) |
755 return commands.help_(ui, cmd) |
771 else: |
771 else: |
772 try: |
772 try: |
773 repo = hg.repository(ui, path=path) |
773 repo = hg.repository(ui, path=path) |
774 if not repo.local(): |
774 if not repo.local(): |
775 raise util.Abort(_("repository '%s' is not local") % path) |
775 raise util.Abort(_("repository '%s' is not local") % path) |
776 repo.ui.setconfig("bundle", "mainreporoot", repo.root) |
776 repo.ui.setconfig("bundle", "mainreporoot", repo.root, 'repo') |
777 except error.RequirementError: |
777 except error.RequirementError: |
778 raise |
778 raise |
779 except error.RepoError: |
779 except error.RepoError: |
780 if cmd not in commands.optionalrepo.split(): |
780 if cmd not in commands.optionalrepo.split(): |
781 if (cmd in commands.inferrepo.split() and |
781 if (cmd in commands.inferrepo.split() and |